Jelastic maven plugin throws gateway time-out on deploy goal - maven

I'm using jelastic to build and deploy spring-boot application with a many classes. It takes few minutes for jelastic to redeploy this application. But when environment starts reloading after plugin execution - plugin throws Gateway time-out.
Here is plugin configuration:
<plugin>
<groupId>com.jelastic</groupId>
<artifactId>jelastic-maven-plugin</artifactId>
<version>${jelastic-maven-plugin.version}</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<email>${jelastic-maven-plugin.login}</email>
<password>${jelastic-maven-plugin.password}</password>
<context>${jelastic-maven-plugin.context}</context>
<environment>${jelastic-maven-plugin.environment-name}</environment>
<comment />
<api_hoster>${jelastic-maven-plugin.hoster-api}</api_hoster>
</configuration>
</plugin>
Here is log from console (I removed File URL from this trace, but I've checked - it was valid):
[INFO] [94%]
[INFO] [95%]
[INFO] [96%]
[INFO] [97%]
[INFO] [98%]
[INFO] [99%]
[INFO] [100%]
[INFO] File UpLoad : SUCCESS
[INFO] File URL : http://{{host}}/xssu/rest/download/{{fileid}}
[INFO] File size : 61768307
[INFO] ------------------------------------------------------------------------
[INFO] File registration : SUCCESS
[INFO] Registration ID : 16518
[INFO] Developer ID : 1431
[INFO] ------------------------------------------------------------------------
[ERROR] Gateway Time-out
org.apache.http.client.HttpResponseException: Gateway Time-out
at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:67)
at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:55)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:945)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
at com.jelastic.JelasticMojo.deploy(JelasticMojo.java:667)
at com.jelastic.DeployMojo.execute(DeployMojo.java:40)
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.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)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:18.859s
[INFO] Finished at: Sun Jul 30 11:26:03 MSK 2017
[INFO] Final Memory: 13M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jelastic:jelastic-maven-plugin:1.8.1:deploy (default-cli) on project dance-form: Execution default-cli of goal com.jelastic:jelastic-maven-plugin:1.8.1:deploy failed. NullPointerException -> [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/PluginExecutionException
I checked in console that environment was reloaded as the result of this execution.
How can I increase time-out in jelastic maven plugin?

Related

How to release Xtext 2.13 project to Maven Central

I have created an Xtext Language and I want to release it to Maven central. I have already prepared the release with:
mvn release:prepare
My first try to release with
mvn release:perform
failed due to the strict Javadoc checking (Xtext generates some tags that are not understood by the javadoc plugin). So I added this to my pluginManagement section, to silence the errors and convert them into warnings:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
However, this fails with
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:1.0.0:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.0.0:p2-metadata failed.
What could be the reason for this error? It happens immediately after the warnings for the Javadoc, if that matters.
EDIT: After I manually executed the steps from the Maven log, I got the full stack trace:
[INFO] [ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-
plugin:1.1.0-SNAPSHOT:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.: IllegalArgumentException -> [Help 1]
[INFO] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata (attach-p2-metadata) on project com.hribol.bromium.dsl: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[INFO] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] Caused by: org.apache.maven.plugin.PluginExecutionException: Execution attach-p2-metadata of goal org.eclipse.tycho:tycho-p2-plugin:1.1.0-SNAPSHOT:p2-metadata failed.
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
[INFO] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[INFO] ... 20 more
[INFO] Caused by: java.lang.IllegalArgumentException
[INFO] at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.getCanonicalArtifact(P2GeneratorImpl.java:193)
[INFO] at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.generateMetadata(P2GeneratorImpl.java:146)
[INFO] at org.eclipse.tycho.plugins.p2.P2MetadataMojo.attachP2Metadata(P2MetadataMojo.java:149)
[INFO] at org.eclipse.tycho.plugins.p2.P2MetadataMojo.execute(P2MetadataMojo.java:108)
[INFO] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[INFO] ... 21 more
EDIT 2: After following the workaround from here - moving the tycho p2 plugin only to the projects that need it - feature, repository and target, the build no longer breaks with IllegalArgumentException. This time it fails in the signing phase, because a file named p2content.xml is missing. Does anyone know what could be the reason? If I just build the project with mvn clean install the p2content.xml is indeed created, so I think that is probably due to some wrong execution order.

Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin deploy failed. NullPointerException

While running command
mvn -X clean deploy
I am getting following error
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # something ---
[DEBUG] [buildinfo] Resolved artifact: org.apache.maven.plugins:maven-deploy-plugin:pom:2.7:build from: team (http://myrepo/maven/m2repos, releases+snapshots) Context is: plugin
[DEBUG] [buildinfo] Resolved artifact: org.apache.maven.plugins:maven-deploy-plugin:jar:2.7:build from: team (http://myrepo/maven/m2repos, releases+snapshots) Context is: plugin
[DEBUG] [buildinfo] Resolved artifact: junit:junit:jar:3.8.1:build from: C:\Users\user\.m2\repository (enhanced) Context is: plugin
[DEBUG] [buildinfo] Resolved artifact: org.codehaus.plexus:plexus-utils:jar:1.5.6:build from: C:\Users\user\.m2\repository (enhanced) Context is: plugin
[INFO] Uploading: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.war
[INFO] Uploaded: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.war (162384 KB at 23020.0 KB/sec)
[INFO] Uploading: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.pom
[INFO] Uploaded: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.pom (46 KB at 27.3 KB/sec)
[INFO] Downloading: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml
[INFO] Downloaded: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml (19 KB at 162.1 KB/sec)
[INFO] Uploading: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml
[INFO] Uploaded: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml (19 KB at 12.6 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:07.223s
[INFO] Finished at: Thu Apr 27 21:40:53 PDT 2017
[INFO] Final Memory: 54M/568M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project myproject: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project myproject: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
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:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:185)
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:497)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
Caused by: java.lang.NullPointerException
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:178)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
... 31 more
[ERROR]
[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/PluginExecutionException
If i look at my maven repo, all files are already uploaded with build as seen in log (it says uploaded for files), But at last build status failed with nullpointer exception. I have no clue even after enabling debug mode.
Any help please.
Upgrading to recent version of maven-deploy-plugin solved the issue for me.
E.g.:
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
</plugins>
</build>

Maven: compile OK, package OK, compile + package fails

I have a desktop Java project using Dagger2 and building with Maven. I can't run compile and package sequentially. This works:
$ mvn clean
$ mvn compile
And this works, producing an executable jar that runs without error:
$ mvn clean
$ mvn package
But this fails:
$ mvn clean
$ mvn compile
$ mvn package
When package gets to the module that uses Dagger2, it outputs:
[INFO] Changes detected - recompiling the module!
The error from mvn -e package is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: 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: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: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.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:915)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
The module has this dependency:
<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
The module uses compiler plugin version 3.3 like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger-compiler</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<configuration>
<source>1.7</source>
<target>1.7</target>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
This is the only Dagger-related configuration. Why can't I run package after build?
Possibly related: I thought forceJavacCompilerUse was no longer needed, but without it, Dagger doesn't seem to run at all. I get an unknown symbol error on the generated component implementation (DaggerMyComponent).
Edit: This is the full output of mvn -e package, command prompt to command prompt:
kevin#aphrodite:~/Projects/IDEA/Dark Matter$ mvn -e package
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parent
[INFO] weapon
[INFO] scripts
[INFO] assembly
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building parent 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building weapon 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # weapon ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # weapon ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /home/kevin/Projects/IDEA/Dark Matter/weapon/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent ............................................ SUCCESS [0.001s]
[INFO] weapon ............................................ FAILURE [1.641s]
[INFO] scripts ........................................... SKIPPED
[INFO] assembly .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.735s
[INFO] Finished at: Fri Mar 11 04:32:38 MST 2016
[INFO] Final Memory: 21M/173M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project weapon: 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: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: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.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:915)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
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] 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :weapon
kevin#aphrodite:~/Projects/IDEA/Dark Matter$
Edit 2: I noticed that when I run package by itself after clean, it says it's compiling 6 sources. That's how many hand-written classes are in the project. When I run compile before package, the latter says it's compiling 8 sources. It looks like when dagger-compiler runs on a clean project, it silently generates and compiles its sources. Then package sees the new sources and tries to compile them. The mystery is why it fails. Running compile twice in a row fails in the same way.
Edit 3: I tried this answer, specifying dagger.internal.codegen.ComponentProcessor as the -processor argument. Now the first time I run compile, I see the two passes where it compiles 6 files and then 8 files:
[INFO] --- maven-compiler-plugin:3.3:compile (process-annotations) # weapon ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /home/kevin/Projects/IDEA/Dark Matter/weapon/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # weapon ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # weapon ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /home/kevin/Projects/IDEA/Dark Matter/weapon/target/classes
This is expected, and this compile succeeds. But then if I run package, or compile again, it fails the same as before.
The sources Dagger produces are in /target/generated-sources/annotations. I think I need to tell Maven to do something with that path, but I don't know what. It makes sense that compile detects source changes when it is run twice in a row, though I don't know why that leads to failure. Maybe I need to run the annotation processing step conditionally, but I don't know how to do that or what the condition should be.
I managed to reproduce your problem.
The key seems to be the maven-compiler-plugin:3.3
When I run with maven-compiler-plugin:3.1, the error does not manifest.

java.nio.file.NoSuchFileException and java.io.EOFException when tring to build Jenkins Plugin from source

I am tring to build Cucumber Test Result Plugin (0.8.2) and I am receiving the following error after mvn package:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: java.nio.file.NoSuchFileException: /home/chrisandrew/sources/cucumber-testresult-plugin/target/classes/META-INF/exposed.stapler-beans
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.527s
[INFO] Finished at: Thu Aug 20 17:33:31 BST 2015
[INFO] Final Memory: 27M/92M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project cucumber-testresult-plugin: Compilation failure
[ERROR] error: java.nio.file.NoSuchFileException: /home/chrisandrew/sources/cucumber-testresult-plugin/target/classes/META-INF/exposed.stapler-beans
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project cucumber-testresult-plugin: Compilation failure
error: java.nio.file.NoSuchFileException: /home/chrisandrew/sources/cucumber-testresult-plugin/target/classes/META-INF/exposed.stapler-beans
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:504)
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
error: java.nio.file.NoSuchFileException: /home/chrisandrew/sources/cucumber-testresult-plugin/target/classes/META-INF/exposed.stapler-beans
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
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 tried "resolving" these errors by creating two empty files target/classes/META-INF/exposed.stapler-beans and target/classes/META-INF/annotations/hudson.Extension (don't know if I should have done this, probably not...) and now I get this:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: java.io.EOFException
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.443s
[INFO] Finished at: Thu Aug 20 16:48:45 BST 2015
[INFO] Final Memory: 27M/91M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project cucumber-testresult-plugin: Compilation failure
[ERROR] error: java.io.EOFException
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5:compile (default-compile) on project cucumber-testresult-plugin: Compilation failure
error: java.io.EOFException
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:504)
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
error: java.io.EOFException
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
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
mvn -v output:
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T08:57:37-03:00)
Maven home: /opt/apache-maven-3.3.3
Java version: 1.9.0-ea, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-9-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-25-generic", arch: "amd64", family: "unix"
What am I doing wrong?
Got the same error with java-9, compiled successfully using oracle jdk 1.8

Sonar Sensor Maven dependencies

I'm trying to deploy some measures into Sonar 3.5 without using internal analyzers (CPD, SQUID ...) every thing seems to be ok but at the Maven dependency analysis i get the nullpointer Exception :
INFO] [08:23:01.789] Sensor Maven dependencies...
[DEBUG] Dependency tree resolution listener events:
[DEBUG] testArtifact: artifact=fr.tus.mvn-test:test-app:nar:2.0-SNAPSHOT
[DEBUG] includeArtifact: artifact=fr.tus.mvn-test:test-app:nar:2.0-SNAPSHOT
[DEBUG] startProcessChildren: artifact=fr.tus.mvn-test:test-app:nar:2.0-SNAPSHOT
[DEBUG] [08:23:01.797] Release semaphore on project : org.sonar.api.resources.Project#68dc2d[id=158,key=fr.tus:mvn-test,qualifier=TRK], with key batch-fr.tus:mvn-test
[DEBUG] [08:23:01.814] To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
[DEBUG] [08:23:01.819] Delete temporary directory: /tmp/sonar-batch59250110776125096297764152719386
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] mvn-test Project .................................. FAILURE [6.679s]
[INFO] mvn-library Project ............................... SKIPPED
[INFO] mvn-app Project ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.481s
[INFO] Finished at: Sat Sep 21 08:23:01 PDT 2013
[INFO] Final Memory: 13M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.5:sonar (default-cli) on project mvn-test: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.5:sonar failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.5:sonar (default-cli) on project mvn-test: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.5:sonar failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
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: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.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.5:sonar failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:579)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:192)
at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.recurse(DefaultLegacyArtifactCollector.java:532)
at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect(DefaultLegacyArtifactCollector.java:144)
at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect(DefaultLegacyArtifactCollector.java:100)
at org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector.collect(DefaultLegacyArtifactCollector.java:782)
at org.apache.maven.shared.dependency.tree.DefaultDependencyTreeBuilder.buildDependencyTree(DefaultDependencyTreeBuilder.java:97)
at org.sonar.plugins.design.batch.MavenDependenciesSensor.analyse(MavenDependenciesSensor.java:73)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.Phases.execute(Phases.java:101)
at org.sonar.batch.scan.ScanContainer.doStart(ScanContainer.java:147)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:54)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:49)
at org.sonar.batch.bootstrap.TaskContainer.doStart(TaskContainer.java:188)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:150)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 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/PluginExecutionException
When I run mvn dependency:tree the dependency tree is displayed correctly.
Thank you for your help.
Nadir.
As you're using Maven to compile C/C++ plugin, SonarQube is trying to analyse the dependencies that are specified in your POM. It looks like one of those is relocated but Maven can't manage to retrieve it - but I can't tell you how to fix this.
What you can do is to run the SonarQube analysis using SonarQube Runner - which won't try to run the MavenDependenciesSensor class. I'm pretty sure this will solve your issue.

Resources