user3305610
user3305610

Reputation: 21

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6: run (pre-dist) on project hadoop-project-dist:

I need help as i am trying to figure this out from last 2-3 days..

I am setting up Hadoop on Windows-7 (64-bit) machine. This is to try out the integration of R with Hadoop.

I followed instructions for Hadoop installation as given in the URL - http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os

Environment Variables are as below JAVE_HOME : C:\Program Files\Java\jdk1.6.0_45 M2_HOME : C:\Hadoop\apache-maven-3.1.1 PATH : C:\cygwin64\bin;C:\Hadoop\apache-maven-3.1.1\bin;C:\Hadoop\protoc-2.5.0-win32

mvn package -Pdist,native-win -DskipTests -Dtar

i ran above command from Windows SDK 7.1 command prompt and getting error below... Early help is hugely appreciated..

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

    [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

Thanks in advance Gopal

Upvotes: 2

Views: 11296

Answers (4)

Z.Wang
Z.Wang

Reputation: 21

I use the following command, it succeeds.

mvn clean package -DskipTests -Dtar

Upvotes: 2

Andrey Tikhonov
Andrey Tikhonov

Reputation: 11

I had the same error. When I ran mvn package -Pdist,native-win -DskipTests -Dtar with -X, maven showed me that there are some troubles with executing dist-copynativelibs.sh script.

The problem was that Windows command prompt can't run sh commands, but only bash commands. Don't know why - Cygwin was installed correctly and added to path. So I have changed executable="sh" to executable="bash" in pom file D:\hdfs\hadoop-project-dist\pom.xml:

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

and build was success.

Upvotes: 1

user3714023
user3714023

Reputation: 21

Have you solved the problem? I had the similar problem when I was installing Hadoop. I found that all the problems in building the source file phase were related to Path variable setting.

1. Make sure you have JDK installed not only JRE available

2. One additional path setting needed, if you are following instruction on this link: http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os : Add .NET MsBuild.exe home directory to Path, it should be similar to this C:\Windows\Microsoft.NET\Framework64\v4.030319

3. Check all the path values are corrected. During my installation, I had a problem which was related to Cygwin path, cygwin was installed in the folder named cygwin64, but at the beginning I just add cygwin as path value, which took me some time to figure it out.

Upvotes: 2

Rushikesh Garadade
Rushikesh Garadade

Reputation: 627

"mvn package -Pdist,native-win -DskipTests -Dtar" According to this command you are trying to compile and package "native libraries"(native-win keyword) and to do this whatever packages given in your given link is not sufficient.

To solve this you have two alternatives:

1) No need of native libraries, hadoop will use "builtin-java classes" instead of native libraries. use this command : "mvn package -Pdist -DskipTests -Dtar" instead of yours

2)if you want to go for native libraries- Follow Native Libraries Guide. Here all needed packages and other important information for building native libraries is given.

My suggestion is use 1st option because i read somewhere that building native libraries on windows have lot of issues and not preferred on windows.

Read "Building.txt" in Hadoop src folder it may help you for using variety of commands for packaging.

Above may be the solution for your problem.Try it

Upvotes: 1

Related Questions