Can not execute Findbugs: java.lang.OutOfMemoryError: Java heap space, while running mvn sonar:sonar -X - maven

i am trying to do the code analysis in sonar 2.11, using maven 3.
I am facing this error
java.lang.OutOfMemoryError: Java heap space.
i tried to increase the MAVEN_OPTS to -Xmx1024m -Xms512m -XX:MaxPermSize=256m but no use.
The project is of large size of about 900MB. I am using the command mvn sonar:sonar -X in maven 3. But the build is failure.
I am not running the tests or nor using any surefire plugin in my superPOM. So i am unable to find the cause of the problem.
Please help me to figure out where the problem exixts.
Thanks in advance...
Here is the log...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PHOENIX JAVA MODULE COMPONENT ..................... SKIPPED
[INFO] PHOENIX JAVA COMPONENT ............................ FAILURE [1:27:23.969s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:27:26.229s
[INFO] Finished at: Fri Dec 14 14:14:24 IST 2012
[INFO] Final Memory: 287M/1016M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: Can not execute Sonar: Can not execute Findbugs: java.lang.OutOfMemoryError: Java heap space -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: Can not execute Sonar
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: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
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.sonar.api.utils.SonarException: Can not execute Findbugs
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:120)
at org.sonar.plugins.findbugs.FindbugsSensor.analyse(FindbugsSensor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:110)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:105)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:100)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96)
at org.sonar.batch.bootstrap.Module.start(Module.java:89)
at org.sonar.batch.Batch.execute(Batch.java:74)
at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:147)
at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:136)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
... 23 more
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:112)
... 38 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at edu.umd.cs.findbugs.ba.Frame.<init>(Frame.java:110)
at edu.umd.cs.findbugs.ba.vna.ValueNumberFrame.<init>(ValueNumberFrame.java:58)
at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.createFact(ValueNumberAnalysis.java:148)
at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.createFact(ValueNumberAnalysis.java:55)
at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:309)
at edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:72)
at edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:47)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:332)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:282)
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:942)
at edu.umd.cs.findbugs.ba.ClassContext.getValueNumberDataflow(ClassContext.java:361)
at edu.umd.cs.findbugs.detect.FindInconsistentSync2.findObviouslyLockedCallSites(FindInconsistentSync2.java:963)
at edu.umd.cs.findbugs.detect.FindInconsistentSync2.visitClassContext(FindInconsistentSync2.java:311)
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:68)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:979)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:230)
at org.sonar.plugins.findbugs.FindbugsExecutor$FindbugsTask.call(FindbugsExecutor.java:137)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[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 :XXX

This is a well-known problem: Findbugs is really memory hungry, so I'm not surprised that with a 900MB project, you have to increase the JVM memory options quite a lot.
3 things you can do:
increase again the JVM memory options till it is OK
reduce the amount of activated Findbugs rules in your Sonar quality profile
refactor your project is smaller modules so that each module requires less memory to get analyzed by Findbugs
If I were you, I'd really go for at least option #3, because 900MB for a single project is really huge.

I had similar problem where it used to hung on Journal Flushing and ultimately timeout at whatever the value i set in Findbags Java default timeout in sonarqube or give Out of memory error.
I resolved this by using the following options while running the sonar maven command:- MAVEN_OPTS="-Xms256m -Xmx4096m -XX:+UseSerialGC"
This has fixed the issue for me.
The post which helped me:- http://sonarqube-archive.15.x6.nabble.com/SonarQube-terminates-at-quot-Journal-Flusher-quot-warning-and-heap-size-error-td5027066.html

Updating the JDK version on jenkins server to 64 bit solved this issue for me.
Try setting the parameter set SONAR_SCANNER_OPTS=-Xmx1024m in sonar-scanner.bat
or export SONAR_SCANNER_OPTS=-Xmx1024m if invoking through shell script.

Related

maven-release-plugin fails to release:prepare

I'm using mercurial, maven and maven-release-plugin to make a release. While executing task release:prepare it fails with the following stack trace:
[INFO] Transforming 'producer'...
[INFO] Not removing release POMs
[INFO] Checking in modified POMs...
[INFO] EXECUTING: /bin/sh -c cd /home/dir/producer && hg branch
[DEBUG] version-1.1
[INFO] EXECUTING: /bin/sh -c cd /home/dir/producer && hg outgoing
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:16.923s
[INFO] Finished at: Tue Jun 30 16:00:45 MSK 2015
[INFO] Final Memory: 10M/207M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project producer: An error is occurred in the checkin process: Exception while executing SCM command. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project producer: An error is occurred in the checkin process: Exception while executing SCM command.
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:606)
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: An error is occurred in the checkin process: Exception while executing SCM command.
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:281)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:232)
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.shared.release.ReleaseExecutionException: An error is occurred in the checkin process: Exception while executing SCM command.
at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.checkin(AbstractScmCommitPhase.java:160)
at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.performCheckins(AbstractScmCommitPhase.java:145)
at org.apache.maven.shared.release.phase.ScmCommitDevelopmentPhase.runLogic(ScmCommitDevelopmentPhase.java:91)
at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.execute(AbstractScmCommitPhase.java:78)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:277)
... 22 more
Caused by: org.apache.maven.scm.ScmException: Exception while executing SCM command.
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:63)
at org.apache.maven.scm.provider.hg.HgScmProvider.checkin(HgScmProvider.java:223)
at org.apache.maven.scm.provider.AbstractScmProvider.checkIn(AbstractScmProvider.java:415)
at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.checkin(AbstractScmCommitPhase.java:156)
... 30 more
Caused by: java.lang.NullPointerException
at org.apache.maven.scm.provider.hg.HgUtils.differentOutgoingBranchFound(HgUtils.java:313)
at org.apache.maven.scm.provider.hg.command.checkin.HgCheckInCommand.executeCheckInCommand(HgCheckInCommand.java:66)
at org.apache.maven.scm.command.checkin.AbstractCheckInCommand.executeCommand(AbstractCheckInCommand.java:54)
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
... 33 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
After running:
mvn -X clean release:prepare
mvn version: Apache Maven 3.0.4
hg version: Mercurial Distributed SCM (version 2.0.2)
maven-release-plugin version:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
I've spent several hours.. Found nothing relevant to my case and completely stuck. Looks like it fails to execute hg outgoing, but after it fails I can execute hg outgoing with no problems.
What is even more weird is that I could successfully run it on another machine with the same hg and mvn versions.
The only difference I found is that on first box I have Ubuntu 12.04.5 LTS and on the second Ubuntu 12.04.3 LTS. Is it the problem of Ubuntu 12.04.5 ? Hopefully not. But then it's so weird.

Maven by example - NullPointer executing hibernate3:hbm2ddl

I am following the Maven by example guide to learn Maven.
I am busy working through chapter 7, which is a simple multimodule enterprise project containing spring and hibernate. The example files for this chapter can be downloaded here, in the ch-multi-spring directory.
Sections 7.1 to 7.6 talk about the specifics of each module. In section 7, the database is generated and the application is run. It is at this step that I receive the following error:
> mvn hibernate3:hbm2ddl -X
<Some output left out>
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Multi-Spring Chapter Simple Parent Project ........ FAILURE [0.752s]
[INFO] Multi-Spring Chapter Simple Object Model .......... SKIPPED
[INFO] Multi-Spring Chapter Simple Weather API ........... SKIPPED
[INFO] Multi-Spring Chapter Simple Persistence API ....... SKIPPED
[INFO] Multi-Spring Chapter Simple Command Line Tool ..... SKIPPED
[INFO] Multi-Spring Chapter Simple Web Application ....... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.330s
[INFO] Finished at: Thu Apr 24 15:31:18 CEST 2014
[INFO] Final Memory: 9M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project simple-parent: There was an error creating the AntRun task. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project simple-parent: There was an error creating the AntRun task.
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: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.MojoExecutionException: There was an error creating the AntRun task.
at org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:84)
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: java.lang.NullPointerException
at org.codehaus.plexus.configuration.DefaultPlexusConfiguration.add(DefaultPlexusConfiguration.java:175)
at org.codehaus.plexus.configuration.DefaultPlexusConfiguration.addChild(DefaultPlexusConfiguration.java:151)
at org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.setHibernateConfiguration(PlexusConfigurationUtils.java:289)
at org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.parseHibernateTool(PlexusConfigurationUtils.java:67)
at org.codehaus.mojo.hibernate3.AbstractHibernateToolMojo.getConfiguration(AbstractHibernateToolMojo.java:60)
at org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:76)
... 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
Since I'm still learning Maven, and not familiar with Hibernate, I have no idea what the problem could be. I haven't changed anything in the downloaded example files.
I was getting the same error.
I modified the version number of hibernate3-maven-plugin plugin:
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<!-- insted of 2.1 as documented inside the Maven by example guide -->
<version>2.2</version>
....
</groupId>
And this fixed the issue. Moreover, I'm using JDK 1.8. Below the 'mvn -v' output:
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_20\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
I figured out the answer.
Here is the summary of my findings:
the mvn hibernate3:hbm2ddl command should be run from the simple-webapp or simple-command folder. (The specification for the plugin should be present in the POM for that module.)
increasing the hibernate3-maven-plugin version to 3.0 will reintroduce the problem, I believe I read some posts that the configuration format had been changed, but I didn't look further into it.
the mvn hibernate3:hbm2ddl will report the error shown below if JAVA_HOME is set to JDK1.7 instead of 1.6 (Found solution to this here)
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2ddl (default-cli) on project simple-command: Could not get ConfigurationTask.

Usage of maven-release-plugin in Jenkins with integrity (MKS) as Source Code Management

Please notice the second question in the end of this one!
I have got some trouble using Jenkins, the maven-release-plugin and integrity (using MKS) as source code Management (scm).
Well, I try to release my project from MKS via Jenkins to Sonartype Nexus. If I use "deploy" as maven goal within the maven-release-plugin, everything is fine and the release is deployed correct, BUT it is saved as a snapshot in Nexus.
To avoid this snapshot problem I decided to use the maven-release-plugin with release:perform. It should change the version number to a version without snapshot (like: 1.0.0), release it and add snapshot to the version number back again when the release was done. Version is increased also (like 1.0.1-SNAPSHOT).
But if I use "release:prepare" or "release:perform" as maven goals the output tells me:
[ERROR] No SCM URL was provided to perform the release from
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.405s
[INFO] Finished at: Fri Feb 14 11:56:40 CET 2014
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:perform (default-cli) on project javatests-test04: No SCM URL was provided to perform the release from -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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
After I searched a now for a long time but did not found the answer I needed I came up with the idea to open this new question.
I tried things like:
adding information to pom.xml but not even sure if maven realized it (did not know what the correct URL would be for me was or if I even have one so I didn't changed it)
original from this site:
<scm>
<connection>scm:git:git#github.com:user/project.git</connection>
<url>scm:git:git#github.com:user/project.git</url>
<developerConnection>scm:git:git#github.com:user/project.git</developerConnection>
</scm>
my version:
<scm>
<connection>scm:integrity|myUser#myServer:7001|#p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04 </connection>
<url>scm:git:git#github.com:user/project.git</url>
<developerConnection>scm:integrity|myUser#myServer:7001|#p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04</developerConnection>
</scm>
I changed the maven goal as a second try(same with -Dproject.scm.developerConnerction):
release:perform -DconnectionUrl=scm:integrity:myUser#myMksServer:7001|#p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04
but it leads to a new error:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.0:prepare
(default-cli) on project javatests-test04: The provider given in the
SCM URL could not be found: No such provider: 'integrity'.
I fact it works fine with "deploy" as maven goal, I am sure this is not the fault of wrong paths to project or to Sonartype Nexus.
Can anybody help me and/or tell me what my Maven goal should be like?
Do I have th change things in the pom? in the master pom? I want the release statement work...
I found a workaround that worked for me:
The plugin genreates some environment variables. Most of them are given and created automatic and one (IS_M2RELEASEBUILD) is editable in in the advanced settings of the option point "maven release build"
My solution:
1.) Check the "Maven release build" in the build environment to gain access to some values later.
2.) Create a "Conditional Step (Single)" as a Pre Step AND as a Post Step
2.1) Both should have a Boolean condition with a token: ${ENV,var="IS_M2RELEASEBUILD"}
2.2) Both should have "call Maven goal" as build step.
Goal for the pre step: *versions:set -DnewVersion=${MVN_RELEASE_VERSION}*
Goal for the post step: *versions:set -DnewVersion=${MVN_DEV_VERSION}*
The value of this variables are the same you enter when a release build is started.
3.) As "normal" build step i simple call a maven goal with "compile"
4.) Add Post-Build-Action: Integrity - CM Checkin with path to your MKS project and other options that are maybe needed here.
5.) Finished! (Dont forget to set your Distribution options in your pom.xml to tell Jenkins and Maven where the release results should be saved)
EDIT: I FOUND A WORKAROUND! SEE ANSWEAR WITH SOLUTION!
Okay, i have done 1 step in the right direction!
Just needed to add a reference into the pom.xml of my project to the currently used maven-release-plugin:
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<checkModificationExcludes>
<checkModificationExclude>**/*pom.xml*</checkModificationExclude>
<checkModificationExclude>**/*.log</checkModificationExclude>
<checkModificationExclude>**/*.jar</checkModificationExclude>
<checkModificationExclude>**/target/**</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
</plugins>
</build>
BUT:
Now i have some other problems:
Console tells me that the login to MKS fails. The called user has got read AND write permissions, path to project and to Jenkins server are set right. I also made sure that the MKS folder is first in my path envionment variables. Just for your information: of course i used a real user with real password and real server and not "myUser", "myPassword" or "myServer"
I am pretty sure that i use the right configurations for my scm (developer-)connetction settings, because before the release takes part i download the projects content from MKS to my server with success! No error comes up here...
Usage of "scm:validate" tells me:
[INFO] --- maven-scm-plugin:1.9:validate (default-cli) # javatests-test04 ---
[INFO] MKS Integrity API Version: 4.10
[INFO] connectionUrl scm connection string is valid.
[INFO] MKS Integrity API Version: 4.10
[INFO] project.scm.connection scm connection string is valid.
[INFO] MKS Integrity API Version: 4.10
[INFO] project.scm.developerConnection scm connection string is valid.
What could be the reason for connections failures?
Console:
[...some more console output...]
Executing Maven: -B -f (pathToProject)\workspace\pom.xml -DdevelopmentVersion=0.0.5-SNAPSHOT -DreleaseVersion=0.0.4 -Dusername=myUser -Dresume=false compile release:prepare -Dpassword=**********
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my test project 0.0.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.4.1:prepare (default-cli) # javatests-test04 ---
[some other debug infos]
[DEBUG] -- end configuration --
[DEBUG] User/Password information supplied: myUser/myPasswort
[DEBUG] Host/Port information supplied: myServer:7001
[INFO] MKS Integrity API Version: 4.10
[DEBUG] Configuration Path: #p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: **\release.properties, **\pom.xml.next, **\*pom.xml*, **\*.jar, **\pom.xml.releaseBackup, **\pom.xml.backup, **\pom.xml.branch, **\target\**, **\pom.xml.tag, **\*.log
[DEBUG] User/Password information supplied: myUser/myPasswort
[DEBUG] Host/Port information supplied: myServer:7001
[INFO] MKS Integrity API Version: 4.10
[DEBUG] Configuration Path: #p=d:/MKS/Tools/Tools.pj#s=Tests/Tests.pj#javatests-test04
[INFO] Attempting to connect with the MKS Integrity Server
[INFO] Creating session for myUser/***********
[INFO] Attempting to establish connection using myUser#myServer:7001
com.mks.connect.BlimpException: Attempt to launch MKS Integrity Client Timed out. To solve this please try the following:
- Verify that the user you are logged in as has read and write permissions to the Integrity Client install directory.
- Make sure the Integrity Client install directory is the very first entry in the path.
at com.mks.connect.ClientCmdRunnerImpl.icInitialize(Native Method)
at com.mks.connect.ClientCmdRunnerImpl.checkIntegrityClientForLaunch(ClientCmdRunnerImpl.java:71)
at com.mks.connect.ClientCmdRunnerImpl.executePreCondition(ClientCmdRunnerImpl.java:95)
at com.mks.connect.AbstractCmdRunner.executeCommand(AbstractCmdRunner.java:235)
at com.mks.connect.AbstractCmdRunner.execute(AbstractCmdRunner.java:394)
at org.apache.maven.scm.provider.integrity.APISession.connect(APISession.java:134)
at org.apache.maven.scm.provider.integrity.command.login.IntegrityLoginCommand.executeLoginCommand(IntegrityLoginCommand.java:66)
at org.apache.maven.scm.command.login.AbstractLoginCommand.executeCommand(AbstractLoginCommand.java:45)
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
at org.apache.maven.scm.provider.integrity.IntegrityScmProvider.login(IntegrityScmProvider.java:182)
at org.apache.maven.scm.provider.AbstractScmProvider.login(AbstractScmProvider.java:742)
at org.apache.maven.scm.provider.AbstractScmProvider.status(AbstractScmProvider.java:784)
at org.apache.maven.shared.release.phase.ScmCheckModificationsPhase.execute(ScmCheckModificationsPhase.java:126)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:277)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:232)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
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.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[ERROR] MKS API Exception: Attempt to launch MKS Integrity Client Timed out. To solve this please try the following:
- Verify that the user you are logged in as has read and write permissions to the Integrity Client install directory.
- Make sure the Integrity Client install directory is the very first entry in the path.
[INFO] exited with return code -1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.694s
[INFO] Finished at: Mon Feb 17 16:49:07 CET 2014
[INFO] Final Memory: 17M/310M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project javatests-test04: An error occurred during the status check process: Can't login.
[ERROR] Exit Code: -1
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project javatests-test04: An error occurred during the status check process: Can't login.
Exit Code: -1
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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
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.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error occurred during the status check process: Can't login.
Exit Code: -1
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:281)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:232)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 30 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: An error occurred during the status check process: Can't login.
Exit Code: -1
at org.apache.maven.shared.release.phase.ScmCheckModificationsPhase.execute(ScmCheckModificationsPhase.java:131)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:277)
... 33 more
Caused by: org.apache.maven.scm.ScmException: Can't login.
Exit Code: -1
at org.apache.maven.scm.provider.AbstractScmProvider.login(AbstractScmProvider.java:746)
at org.apache.maven.scm.provider.AbstractScmProvider.status(AbstractScmProvider.java:784)
at org.apache.maven.shared.release.phase.ScmCheckModificationsPhase.execute(ScmCheckModificationsPhase.java:126)
... 38 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[JENKINS] Archiving pathToWorkspace\workspace\pom.xml to pathToRepository/javatests-test04/0.0.4-SNAPSHOT/javatests-test04-0.0.4-SNAPSHOT.pom
[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
channel stopped
Finished: FAILURE
Thanks for your Help! :)

Building Hadoop with Maven - "Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (create-testdirs)"

I'm trying to build the Hadoop trunk using Maven. I got the project with svn. But then, I tried mvn clean install. But I'm getting the following error:
[INFO] Apache Hadoop Main ................................ SUCCESS [1.616s]
[INFO] Apache Hadoop Project POM ......................... FAILURE [0.322s]
[INFO] Apache Hadoop Annotations ......................... SKIPPED
[INFO] Apache Hadoop Project Dist POM .................... SKIPPED
.... etc ....
.... etc ....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.361s
[INFO] Finished at: Sat Jun 15 20:52:13 IST 2013
[INFO] Final Memory: 18M/43M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (create-testdirs) on project hadoop-project: Error executing ant tasks: /home/sreejith/svn/hadoop-trunk/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.6:run (create-testdirs) on project hadoop-project: Error executing ant tasks: /home/sreejith/svn/hadoop-trunk/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:601)
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: Error executing ant tasks: /home/sreejith/svn/hadoop-trunk/hadoop-project/target/antrun/build-main.xml (No such file or directory)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:287)
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: /home/sreejith/svn/hadoop-trunk/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:104)
at org.codehaus.plexus.util.FileUtils.fileWrite(FileUtils.java:470)
at org.apache.maven.plugin.antrun.AntRunMojo.writeTargetToProjectFile(AntRunMojo.java:499)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:226)
... 21 more
I googled all I could. Could someone give me a clue why this is happening?
Found a solution. Do a sudo chown -R username parent-directory if you haven't already. Now try, mvn install -DskipTests. Everything should go fine and you should get BUILD SUCCESS.
P.S: Thanks ThomasJungblut
Try running 'protoc' and verify that it has the right GCC libraries installed. That was a problem I had on a build from source. It happened when I ran the command in a window where I had sourced a bunch of library configs for a software program, which seemed to screw up the proper library loading.
I had built and installed the google protoc from source, and downloaded maven, and installed, and worked off the raw git of hadoop-common. No other prep work changed from standard Centos6.

How can I tell jenkins I do want the full error trace from a maven job?

Running a maven job in jenkins fails with that console output: Finished: FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:52.431s
[INFO] Finished at: Tue Mar 27 17:17:54 CEST 2012
[INFO] Final Memory: 69M/145M
[INFO] ------------------------------------------------------------------------
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project com.visualligence.g: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project com.visualligence.g: 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:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
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.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:104)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: copied.org.apache.maven.plugin.CompilationFailureException: Compilation failure
at copied.org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:409)
at org.eclipse.tycho.compiler.AbstractOsgiCompilerMojo.execute(AbstractOsgiCompilerMojo.java:179)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
channel stopped
Finished: FAILURE
And every log file found on workspace ends the same way.
But running
../../../tools/maven/bin/mvn install
from a prompt, inside
/var/lib/jenkins/jobs/visualligence/workspace
outputs a full error trace with the compilation errors that can help to solve the problem:
(...)
[INFO] Compiling 10 source files to /var/lib/jenkins/jobs/visualligence/workspace/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:47.960s
[INFO] Finished at: Tue Mar 27 17:39:27 CEST 2012
[INFO] Final Memory: 65M/169M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project com.visualligence.g: Compilation failure: Compilation failure:
[ERROR] /var/lib/jenkins/jobs/visualligence/workspace/src/com/visualligence/g/generator/Main.java:[30,0]
[ERROR] Injector injector = new com.visualligence.g.VMLStandaloneSetupGenerated().createInjectorAndDoEMFRegistration();
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(...)
How can I tell jenkins I do want that error trace?
mvn --help lists down options you can use with mvn command.
-e,--errors Produce execution error messages
-X,--debug Produce execution debug output
-q,--quiet Quiet output - only show errors
Should you not be using maven with -e option to track down errors in jenkins job configuration.
Just add -X option to the Maven command line in the Jenkins configuration. But be aware that the output can be very long.
for this there are two possible ways to find out where your problem is:
add -Xdebug to your MAVEN_OPTS
set MAVEN_OPTS=-Xmx1024m -Xms1024m -Xdebug
call mvn clean install
Or look for the failure via remote debugging. For this add the "maven-compiler-plugin" to one of your eclipse projects and start the maven build on your broken project with
set MAVEN_OPTS=-Xmx1024m -Xms1024m -Xdebug -XX:PermSize=256m -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y
call mvn install Than start a remote debug session in eclipse and add a "error" brake point to "CompilationFailureException" this will figure out your problem immediately.
Wish you much luck for it
I could be way off base here, but it looks like
Injector injector = new com.visualligence.g.VMLStandaloneSetupGenerated().createInjectorAndDoEMFRegistration();
is cuasing an error, either because you have a null reference, or because the library that the class comes from wasn't marked properly as a dependancy.

Resources