org.apache.maven.plugin.MojoExecutionException: protoc failure - java

I meet some problems when i use maven to complie hadoop from source code.Here is the error, can anyone help me? Thanks.
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-c
[Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAP
plugin.MojoExecutionException: protoc failure
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: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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.apache.maven.plugin.MojoExecutionException: protoc failure
at org.apache.hadoop.maven.plugin.protoc.ProtocMojo.execute(ProtocMojo.java:81)
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: org.apache.maven.plugin.MojoExecutionException: protoc failure**
at org.apache.hadoop.maven.plugin.protoc.ProtocMojo.execute(ProtocMojo.java:78)
... 21 more
[ERROR]
[ERROR]

The instructions at http://wiki.apache.org/hadoop/HowToContribute explain some of the less obvious aspects of building hadoop - including this one. The main problem here is that Protocol Buffers are required by hadoop's YARN framework, and you most likely do not have them installed.
It seems like the problem might be that your not interpretting the error correctly, so --
How to Isolate the Build error
Any mojo which fails should be associated with a class.
In this case, the mojo that is failing is here :
https://svn.apache.org/repos/asf/hadoop/common/trunk/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
Looking at the code, its clear that this Mojo requires the "protoc" program to run.
http://code.google.com/p/protobuf/
Solution
To build hadoop, you need protocol buffers. This can be installed on a *NIX machine from source, by running the following commands to grab the code from googlecode (taken from http://numbers.brighterplanet.com/2012/04/14/how-to-install-mosh-on-amazon-ec2/).
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
tar xzf protobuf-2.4.1.tar.gz
cd protobuf-2.4.1
./configure
make
sudo make install
sudo ldconfig

Related

Maven deploy file error on Jenkins

I am trying to push json report file to Nexus repo. I set Jenkins job to run
mvn -X -e deploy:deploy-file "-DgeneratePom=true"
"-Durl=http://repo_location"
-DrepositoryId=internal-repository" "-DgroupId=com.devsys" "-DartifactId=report" "-Dbuild.number=%BUILD_NUMBER%"
"-Dpackaging=json"
"-Dfile=%WORKSPACE%\backend-acceptance-tests\target\cucumber.json"
However, getting error:
The parameters 'file' for goal
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file are
missing or invalid
I even tried absolute path, still same error, json is sitting in the location specified.
Hope to get another set of eyes to provide feedback on such matter?
Full error
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file
(default-cli) on project workbrain-automation-framework: The
parameters 'file' for goal
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file are
missing or invalid -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file
(default-cli) on project workbrain-automation-framework: The
parameters 'file' for goal
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file are
missing or invalid at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:220)
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:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483) 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.PluginParameterException: The
parameters 'file' for goal
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy-file are
missing or invalid at
org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:581)
at
org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:534)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:97)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
You're missing a quote before -DrepositoryId=. All of your quotes need to be matched up correctly for this to work.

Sonar maven build failing after java8 upgrade

Recently we shifted from java 7 to java 8 in our code base, our sonar build started failing (This was working with Java 7). Mentioning the details of our system:
Java version - 8
SonarQube: 2.0.1
Jenkins: Jenkins ver. 1.653
Sonar-maven-plugin: 2.0 (hard coded in parent pom.xml)
Below is the log :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project XXX: Can not execute SonarQube analysis
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:319)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute SonarQube analysis
at org.codehaus.mojo.sonar.bootstrap.InternalMojoBootstraper.executeMojo(InternalMojoBootstraper.java:111)
at org.codehaus.mojo.sonar.bootstrap.InternalMojoBootstraper.start(InternalMojoBootstraper.java:69)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:142)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:20
SonarQube 2.0.1 is simply not going to work with Java 8. Start by upgrading your server to at least the most recent LTS version (5.6 at this writing). Then remove the hard-coded maven plugin (which I believe is also not going to work with Java 8). And you should be good to go.

maven builds fails inside ubuntu vagrant machine as well as docker instance

I am developing an api using jaxb. The maven build (using jdk-7) works on my local windows machine. Now if I try to build it on my vagrant box (ubuntu/trusty64) after setting up maven and openjdk7 on the vm, I get following error on performing mvn clean install:
java.io.FileNotFoundException (operation not permitted)
There are in all 5 projects as part of my pom.xml, the first 3 (business and projects) gets built successfully, only the 4th one (which generates the war) file fails with this error when it is trying to generate the war file. Maven was successful in copying other files into the target folder for other projects.
Also, I am able to do perform maven builds on the same machine without errors on simple java projects (from https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
My guess is the Vagrant Virtualbox VM is not is not able to allocate required resources to JVM but i am clueless on how i could do it. I did try to increase the memory footprint by setting the maven properties on my vm
export MAVEN_OPTS="-Xms1024m -Xmx4096m -XX:PermSize=1024m"
Detailed error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on project '<app>' : Could not copy webapp classes [/usr/src/<app>/target/classes]: /usr/src/<app>/target/<app>-03.00.00.01-SNAPSHOT/WEB-INF/classes/<my-app-src>/rest/config/ResourceConfig.class (Operation not permitted) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on project <my-app>: Could not copy webapp classes [/vagrant_data/<my-app-src>/<my-app>/target/classes]
[/vagrant_data/<my-app-src>/<my-app>/target/classes]
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: Could not copy webapp classes [/vagrant_data/<my-apps-src>/target/classes]
at org.apache.maven.plugin.war.packaging.ClassesPackagingTask.performPackaging(ClassesPackagingTask.java:80)
at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleClassesDirectory(WarProjectPackagingTask.java:207)
at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:104)
at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:505)
at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:433)
at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:213)
at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:175)
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: /vagrant_data/<my-apps-src>/target/<my-app>-03.00.00.01-SNAPSHOT/WEB-INF/classes/<my-app-src>/rest/config/ResourceConfig.class (Operation not permitted)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:160)
at org.codehaus.plexus.util.FileUtils.doCopyFile(FileUtils.java:1068)
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1049)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:334)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(AbstractWarPackagingTask.java:154)
at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:207)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:149)
at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFiles(AbstractWarPackagingTask.java:104)
at org.apache.maven.plugin.war.packaging.ClassesPackagingTask.performPackaging(ClassesPackagingTask.java:75)
... 27 more
it seems that you don't have permision to write in that folder.
you could try using chmod 777 . -R in the vagrant shared folder. Also before doing this you could check if you can create a new file in the target directory by "touch target/newFile".

Hadoop 2.6.0 Maven Compilation Error on hadoop-yarn-server-nodemanager

I am running into a particular error I haven't seen around on the internet
when compiling hadoop from source.
It seems to be a problem with some missing java packages the error occurs
when trying to compile hadoop-yarn-server-nodemanager
Looks like some java packages are missing or were not gotten by maven.
The build log of everything after the error ocurred is on this gist: https://gist.github.com/grplyler/46025ba50664260fee75
Here is the command I used to compile and package hadoop on the
root of its source:
mvn package -Pdist,native -DskipTest -Dtar -X
My system and environment details:
OS: Linux Mint 17 (Ubuntu 14.10)
Java: java version "1.7.0_75"
Protobuf: 2.5.0
Maven: 3.0.5
Hadoop: 2.6.0
Also installed so I can build the native code (because i want the fuse-dfs part) are:
cmake
zlib
zlib1g-dev
libcurl4-openssl-dev
A similar problem is detailed in this question But it was cause by windows maximum path lengths which is not my case here.
I have been working on this for 2 days now, any feedback or advice as to a solution to the problem would be much appreciated.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hadoop-yarn-server-nodemanager: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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:606)
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.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.TestCompilerMojo.execute(TestCompilerMojo.java:161)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 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/MojoFailureException
I would try and update to the newest version of maven(which is no longer picked up by apt-get)
sudo apt-get remove maven
sudo apt-get install gdebi
wget http://ppa.launchpad.net/natecarlson/maven3/ubuntu/pool/main/m/maven3/maven3_3.2.1-0~ppa1_all.deb
sudo gdebi maven3_3.2.1-0~ppa1_all.deb
sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/maven

hadoop 2.3.0 source build error

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
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
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

Categories

Resources