未能执行goal org.apache.mavenplugins:maven-antrun-plugin:1.6:在项目hadoop上运行(预分布)项目分布:

i5desfxk  于 2021-06-03  发布在  Hadoop
关注(0)|答案(4)|浏览(384)

我需要帮助,因为我正试图从过去的2-3天解决这个问题。。
我正在windows-7(64位)机器上安装hadoop。这是为了尝试r与hadoop的集成。
我遵循了url中给出的hadoop安装说明-http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os
环境变量如下:jave\u home:c:\program files\java\jdk1.6.0\u 45 m2\u home:c:\hadoop\apache-maven-3.1.1路径:c:\cygwin64\bin;c:\hadoop\apache-maven-3.1.1\bin;c:\hadoop\协议-2.5.0-win32
mvn包-pdist,本机win-dskiptests-dtar
我在WindowsSDK7.1命令提示符下运行了上面的命令,得到下面的错误。。。非常感谢您的早期帮助。。


****************************************************************************************

    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] Apache Hadoop Main ................................ SUCCESS [8.893s] 
    [INFO] Apache Hadoop Project POM ......................... SUCCESS [4.782s] 
    [INFO] Apache Hadoop Annotations ......................... SUCCESS [9.500s]
    [INFO] Apache Hadoop Assemblies .......................... SUCCESS [2.145s]
    [INFO] Apache Hadoop Project Dist POM .................... FAILURE [4.141s]
    [INFO] Apache Hadoop Maven Plugins ....................... SKIPPED
    [INFO] Apache Hadoop Auth ................................ SKIPPED
    [INFO] Apache Hadoop Auth Examples ....................... SKIPPED
    [INFO] Apache Hadoop Common .............................. SKIPPED
    [INFO] Apache Hadoop NFS ................................. SKIPPED
    [INFO] Apache Hadoop Common Project ...................... SKIPPED
    [INFO] Apache Hadoop HDFS ................................ SKIPPED
    [INFO] Apache Hadoop HttpFS .............................. SKIPPED
    [INFO] Apache Hadoop HDFS BookKeeper Journal ............. SKIPPED
    [INFO] Apache Hadoop HDFS-NFS ............................ SKIPPED
    [INFO] Apache Hadoop HDFS Project ........................ SKIPPED
    [INFO] hadoop-yarn ....................................... SKIPPED
    [INFO] hadoop-yarn-api ................................... SKIPPED
    [INFO] hadoop-yarn-common ................................ SKIPPED
    [INFO] hadoop-yarn-server ................................ SKIPPED
    [INFO] hadoop-yarn-server-common ......................... SKIPPED
    [INFO] hadoop-yarn-server-nodemanager .................... SKIPPED
    [INFO] hadoop-yarn-server-web-proxy ...................... SKIPPED
    [INFO] hadoop-yarn-server-resourcemanager ................ SKIPPED
    [INFO] hadoop-yarn-server-tests .......................... SKIPPED
    [INFO] hadoop-yarn-client ................................ SKIPPED
    [INFO] hadoop-yarn-applications .......................... SKIPPED
    [INFO] hadoop-yarn-applications-distributedshell ......... SKIPPED
    [INFO] hadoop-mapreduce-client ........................... SKIPPED
    [INFO] hadoop-mapreduce-client-core ...................... SKIPPED
    [INFO] hadoop-yarn-applications-unmanaged-am-launcher .... SKIPPED
    [INFO] hadoop-yarn-site .................................. SKIPPED
    [INFO] hadoop-yarn-project ............................... SKIPPED
    [INFO] hadoop-mapreduce-client-common .................... SKIPPED
    [INFO] hadoop-mapreduce-client-shuffle ................... SKIPPED
    [INFO] hadoop-mapreduce-client-app ....................... SKIPPED
    [INFO] hadoop-mapreduce-client-hs ........................ SKIPPED
    [INFO] hadoop-mapreduce-client-jobclient ................. SKIPPED
    [INFO] hadoop-mapreduce-client-hs-plugins ................ SKIPPED
    [INFO] Apache Hadoop MapReduce Examples .................. SKIPPED
    [INFO] hadoop-mapreduce .................................. SKIPPED
    [INFO] Apache Hadoop MapReduce Streaming ................. SKIPPED
    [INFO] Apache Hadoop Distributed Copy .................... SKIPPED
    [INFO] Apache Hadoop Archives ............................ SKIPPED
    [INFO] Apache Hadoop Rumen ............................... SKIPPED
    [INFO] Apache Hadoop Gridmix ............................. SKIPPED
    [INFO] Apache Hadoop Data Join ........................... SKIPPED
    [INFO] Apache Hadoop Extras .............................. SKIPPED
    [INFO] Apache Hadoop Pipes ............................... SKIPPED
    [INFO] Apache Hadoop Tools Dist .......................... SKIPPED
    [INFO] Apache Hadoop Tools ............................... SKIPPED
    [INFO] Apache Hadoop Distribution ........................ SKIPPED
    [INFO] Apache Hadoop Client .............................. SKIPPED
    [INFO] Apache Hadoop Mini-Cluster ........................ SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 32.981s
    [INFO] Finished at: Thu Feb 13 14:06:51 IST 2014
    [INFO] Final Memory: 32M/190M
    [INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (pre-dist) on project hadoop-project-dist: An Ant BuildException has occured : exec returned: 2 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (pre-dist) on project hadoop-project-dist: An Ant BuildException has occured: exec returned: 2

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException
 has occured: exec returned: 2
        at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:283)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: C:\Hadoop\hdfs\hadoop-project-dist\target\antrun\build-main.xml:31: exec returned: 2
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:650)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:676)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:502)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
        at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:270)
        ... 21 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :hadoop-project-dist

提前谢谢gopal

prdp8dxp

prdp8dxp1#

我使用下面的命令,它成功了。

mvn clean package -DskipTests -Dtar
kq4fsx7k

kq4fsx7k2#

“mvn package-pdist,native win-dskiptests-dtar”根据这个命令,您试图编译和打包“native libraries”(native win关键字),而要做到这一点,给定链接中给出的任何包都是不够的。
要解决这个问题,有两种选择:
1) 不需要本机库,hadoop将使用“内置java类”而不是本机库。使用以下命令:“mvn package-pdist-dskiptests-dtar”而不是您的命令
2) 如果您想使用本机库,请遵循本机库指南。这里给出了构建本机库所需的所有包和其他重要信息。
我的建议是使用第一个选项,因为我在某个地方读到,在windows上构建本机库有很多问题,在windows上不是首选。
阅读hadoop src文件夹中的“building.txt”,它可以帮助您使用各种命令进行打包。
以上可能是解决你问题的方法。试试看

xdyibdwo

xdyibdwo3#

我也犯了同样的错误。当我用-x运行mvn package-pdist、native win-dskiptests-dtar时,maven告诉我执行dist-copynativelibs.sh脚本有一些问题。
问题是windows命令提示符不能运行sh命令,只能运行bash命令。不知道为什么-cygwin安装正确并添加到路径。因此,我将pom文件d:\hdfs\hadoop project dist\pom.xml中的executable=“sh”更改为executable=“bash”:

<exec executable="bash" dir="${project.build.directory}" failonerror="true">
<arg line="./dist-copynativelibs.sh"/>
</exec>

建造成功了。

irlmq6kh

irlmq6kh4#

你解决问题了吗?我在安装hadoop时遇到了类似的问题。我发现构建源文件阶段的所有问题都与路径变量设置有关。
1确保安装了jdk,而不是只有jre可用
2如果您遵循此链接上的说明,则需要一个附加路径设置:http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os :将.net msbuild.exe主目录添加到路径,它应类似于c:\windows\microsoft.net\framework64\v4.030319
三。检查所有路径值是否正确。在我的安装过程中,我遇到了一个与cygwin path有关的问题,cygwin安装在名为cygwin64的文件夹中,但一开始我只是将cygwin添加为path值,这花了我一些时间来解决。

相关问题