How to release Xtext 2.13 project to Maven Central - maven

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.

Related

Maven release issue - JUnit tests run when they shouldn't

I need to be able to run Maven release:prepare / release:perform on an artifact from Jenkins without its JUnit tests running.
Surefire configuration in my test pom.xml
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</execution>
</executions>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</plugin>
Apache’s Surefire documentation suggests using either mvn install -DskipTests or mvn install -Dmaven.test.skip=true. Both work when I run an install:
mvn clean install -Dsurefire.testFailureIgnore=true --show-version --batch-mode -e
But neither argument works when I try them on a release:perform.
I’ve tried the following commands:
mvn -DpreparationGoals=clean release:prepare release:perform -DskipTests -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
I’d expect the tests to be skipped and the release:perform to succeed. Instead, the tests run and fail (see below) causing the entire release:perform to fail.
mvn -DpreparationGoals=clean release:prepare release:perform -Dmaven.test.skip=true -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
I’d expect the tests to be skipped and the release:perform to succeed. Instead, the tests run and fail (see below) causing the entire release:perform to fail.
mvn -DpreparationGoals=clean release:prepare release:perform -Dsurefire.testFailureIgnore=true -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
This isn’t ideal (there’s no need to rerun the JUnit tests since they’ve already been run), but if ignoring the JUnit results allows the release:perform to succeed, that would get us by for now. Instead of ignoring the results, the tests run and still fail, though, causing the entire release:perform to fail.
mvn -DpreparationGoals=clean release:prepare release:perform -fn -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
This isn’t ideal either. It does allow release:perform to complete successfully, but at the expense of end users not being notified if the release:perform fails for other reasons than failed JUnit tests.
Here’s the output from running either release:prepare release:perform -DskipTests or release:prepare release:perform -Dmaven.test.skip=true:
+ mvn -DpreparationGoals=clean release:prepare release:perform -DskipTests -e --batch-mode --show-version -Dusername=**** -Dpassword=**** -Dresume=false
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T11:29:23-06:00)
…
Java version: 1.7.0_71, vendor: Oracle Corporation
…
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-862.11.6.el7.x86_64", arch: "amd64", family: "unix"
[INFO] [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) # TestInvProfileWeb ---
[INFO] [INFO]
[INFO] [INFO] -------------------------------------------------------
[INFO] [INFO] T E S T S
[INFO] [INFO] -------------------------------------------------------
[INFO] [INFO] Running com.investmentprofile.jsf.EndUserBeanTest
[INFO] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.028 s <<< FAILURE! - in com.investmentprofile.jsf.EndUserBeanTest
[INFO] [ERROR] test1(com.investmentprofile.jsf.EndUserBeanTest) Time elapsed: 0.008 s <<< FAILURE!
[INFO] junit.framework.AssertionFailedError
[INFO] at com.investmentprofile.jsf.EndUserBeanTest.test1(Unknown Source)
[INFO]
[INFO] [INFO]
[INFO] [INFO] Results:
[INFO] [INFO]
[INFO] [ERROR] Failures:
[INFO] [ERROR] EndUserBeanTest.test1:48
[INFO] [INFO]
[INFO] [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Reactor Summary:
[INFO] [INFO]
[INFO] [INFO] TestInvProfileWebParent ............................ SUCCESS [ 1.622 s]
[INFO] [INFO] TestInvProfileWebClient ............................ SUCCESS [ 8.253 s]
[INFO] [INFO] TestInvProfileWeb .................................. FAILURE [ 5.333 s]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 15.396 s
[INFO] [INFO] Finished at: 2018-10-19T13:40:42-05:00
[INFO] [INFO] Final Memory: 48M/600M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project TestInvProfileWeb: There are test failures.
[INFO] [ERROR]
[INFO] [ERROR] Please refer to /opt/Jenkins/workspace/unk_TestInvProfileWebParent-YI772VMG3PH6E767GSGQFPUMCBV45RSLSRI75337QAZHUOO63NUQ/target/checkout/TestInvProfileWebParent/TestInvProfileWeb/target/surefire-reports for the individual test results.
[INFO] [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[INFO] [ERROR] -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[INFO] [ERROR]
[INFO] [ERROR] After correcting the problems, you can resume the build with the command
[INFO] [ERROR] mvn <goals> -rf :TestInvProfileWeb
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] TestInvProfileWebParent ............................ FAILURE [ 20.071 s]
[INFO] TestInvProfileWebClient ............................ SKIPPED
[INFO] TestInvProfileWeb .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.508 s
[INFO] Finished at: 2018-10-19T13:40:42-05:00
[INFO] Final Memory: 15M/210M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:perform (default-cli) on project TestInvProfileWebParent: Maven execution failed, exit code: '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:perform (default-cli) on project TestInvProfileWebParent: Maven execution failed, exit code: '1'
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
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: Maven execution failed, exit code: '1'
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:181)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.runLogic(RunPerformGoalsPhase.java:135)
at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(RunPerformGoalsPhase.java:46)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:429)
at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:381)
at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:177)
... 21 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:394)
at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:110)
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
... 26 more
How can I get Surefire not to run tests during release:perform?
Regards,
M.Manojkumar
First, I agree with the two comments above. That said, the problem is that your '-DskipTests' needs to be passed to the release:perform. You can do that by setting the arguments parameter:
mvn release:perform -Darguments=-DskipTests

Build The Xgboost4j raise ErrorException, Can anyone help ?The exception as flowing:

When i try to build the xgboost4j use the command mvn clean install -DskipTests=true ,The Error Exception occurs ! Can anyone has seen this Error Exception before?
My OS is OS X
JDK version is jdk 1.8
python version is 2.7
xgboost code is git clone --recursive https://github.com/dmlc/xgboost
The Error Message as following:
[INFO] argLine set to -javaagent:/Users/zhangkuantian/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/Users/zhangkuantian/code/xgboost/jvm-packages/xgboost4j/target/jacoco.exec
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (native) # xgboost4j ---
/bin/sh: cmake: command not found
building Java wrapper
cd ..
mkdir -p build
cd build
cmake .. -DUSE_S3:BOOL=OFF -DUSE_OPENMP:BOOL=OFF -DPLUGIN_UPDATER_GPU:BOOL=OFF -DUSE_AZURE:BOOL=OFF -DUSE_HDFS:BOOL=OFF -DJVM_BINDINGS:BOOL=ON
Traceback (most recent call last):
File "create_jni.py", line 88, in <module>
run("cmake .. " + " ".join(args) + maybe_generator)
File "create_jni.py", line 51, in run
subprocess.check_call(command, shell=True, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cmake .. -DUSE_S3:BOOL=OFF -DUSE_OPENMP:BOOL=OFF -DPLUGIN_UPDATER_GPU:BOOL=OFF -DUSE_AZURE:BOOL=OFF -DUSE_HDFS:BOOL=OFF -DJVM_BINDINGS:BOOL=ON' returned non-zero exit status 127
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] xgboost-jvm ........................................ SUCCESS [ 3.219 s]
[INFO] xgboost4j .......................................... FAILURE [ 1.359 s]
[INFO] xgboost4j-spark .................................... SKIPPED
[INFO] xgboost4j-flink .................................... SKIPPED
[INFO] xgboost4j-example .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.683 s
[INFO] Finished at: 2017-09-14T17:28:17+08:00
[INFO] Final Memory: 27M/469M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (native) on project xgboost4j: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
I solved it,Though i don't know what the block code in project 'xgboost4j','xgboost4j-example','xgboost-spark','xgboost-flink' 's pom.xml file
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<!-- executions>
<execution>
<id>native</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>python</executable>
<arguments>
<argument>create_jni.py</argument>
</arguments>
<workingDirectory>${user.dir}</workingDirectory>
</configuration>
</execution>
</executions-->
</plugin>
used for, I annotated it, then the issue solved!
[INFO] --- exec-maven-plugin:1.6.0:exec (native) # xgboost4j ---
/bin/sh: cmake: command not found
!!!!!
install cmake, mvn package, and solved!

Jelastic maven plugin throws gateway time-out on deploy goal

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?

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.

Maven test error: javac: source release 1.8 requires target release 1.8 [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
If I run mvn -e test, I get the error:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Skat09 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Skat09 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 191 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # Skat09 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 64 source files to /home/buzz-dee/Workspace/skat09/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] javac: source release 1.8 requires target release 1.8
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.729 s
[INFO] Finished at: 2015-10-02T23:17:02+02:00
[INFO] Final Memory: 10M/298M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project Skat09: Compilation failure
[ERROR] javac: source release 1.8 requires target release 1.8
[ERROR] -> [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 Skat09: Compilation failure
javac: source release 1.8 requires target release 1.8
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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.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
javac: source release 1.8 requires target release 1.8
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:911)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 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
This is my Maven pom.xml:
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<rules>
<requireJavaVersion>
<version>1.8</version>
</requireJavaVersion>
</rules>
<source>1.8</source>
<tagret>1.8</tagret>
</configuration>
</plugin>
</plugins>
The output from mvn -version:
Apache Maven 3.3.3 (NON-CANONICAL_2015-07-27T12:38:38_root; 2015-07-27T11:38:38+02:00)
Maven home: /opt/maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-jdk/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "4.2.2-1-arch", arch: "amd64", family: "unix"
Java JDK (archlinux-java get) setting:
java-8-jdk
Java compiler version (javac -version):
javac 1.8.0_60
I also tried to add:
<verbose>true</verbose>
<fork>true</fork>
<executable>/usr/lib/jvm/java-8-jdk/bin/javac</executable>
<compilerVersion>1.8</compilerVersion>
to the configuration element of the maven-compiler-plugin in the POM.
What is problem for the above error and how can I solve it?
you made a typo: <tagret>1.8</tagret> should be <target>1.8</target>

Resources