0
votes

I am trying to build hadoop.2.3.0. issued the following command:

mvn package -Pdist,native -DskipTests -Dtar

getting the following errors.

    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.124s
    [INFO] Finished at: Sun Jun 22 23:49:21 CDT 2014
    [INFO] Final Memory: 27M/218M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run      

    (create-testdirs) on project hadoop-project: Error executing ant tasks: /work/srchadoop/hadoop-2.3.0-src/hadoop-project/target/antrun/build-main.xml (No such file or directory) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (create-testdirs) on project hadoop-project: Error executing ant tasks: /work/srchadoop/hadoop-2.3.0-src/hadoop-project/target/antrun/build-main.xml (No such file or directory)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    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:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    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: Error executing ant tasks: /work/srchadoop/hadoop-2.3.0-src/hadoop-project/target/antrun/build-main.xml (No such file or directory)
    at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:360)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.io.FileNotFoundException: /work/srchadoop/hadoop-2.3.0-src/hadoop-project/target/antrun/build-main.xml (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:99)
    at org.codehaus.plexus.util.FileUtils.fileWrite(FileUtils.java:470)
    at org.apache.maven.plugin.antrun.AntRunMojo.writeTargetToProjectFile(AntRunMojo.java:608)
    at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:263)
    ... 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

2
add these to your maven command -e -X and paste the detailed error messagejmj
so you are missing this file Caused by: java.io.FileNotFoundException: /work/srchadoop/hadoop-2.3.0-src/hadoop-project/target/antrun/build-main.xml (No such file or directory)jmj
check your configuration in pom.xml you are referring to this filejmj

2 Answers

2
votes

The error occurred due to the permissions of folder in which the code was residing. I ran the command with sudo and error was resolved, I was able to build with out any issues.

sudo mvn package -Pdist,native -DskipTests -Dtar

0
votes

I think its a permission issue, This worked for me. And make sure you have the correct LD_LIBRARY_PATH.

sudo chown -R username parent-directory

username -> eg: ubuntu) parent-directory -> hadoop source directory

And then run

mvn package -Pdist,native -DskipTests -Dtar