Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project mahout-math: There are test failures - maven

Trying to install Mahout on Ubuntu16.04, I have successfully install maven 3.3.9 and subversion 1.9.3. New to mahout and maven, I don't know if I should skip the test and just use
mvn -DskipTests
Here is the error I got:
[INFO] Mahout Build Tools ................................. SUCCESS [ 6.621 s]
[INFO] Apache Mahout ...................................... SUCCESS [ 1.164 s]
[INFO] Mahout Math ........................................ FAILURE [03:35 min]
[INFO] Mahout MapReduce Legacy ............................ SKIPPED
[INFO] Mahout Integration ................................. SKIPPED
[INFO] Mahout Examples .................................... SKIPPED
[INFO] Mahout Release Package ............................. SKIPPED
[INFO] Mahout Math/Scala wrappers ......................... SKIPPED
[INFO] Mahout Spark bindings .............................. SKIPPED
[INFO] Mahout Spark bindings shell ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:44 min
[INFO] Finished at: 2016-10-07T19:05:02-07:00
[INFO] Final Memory: 33M/134M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-
surefire-plugin:2.16:test (default-test) on project mahout-math: There are test failures.
[ERROR]
[ERROR] Please refer to/home/flora/.linuxbrew/Cellar/mahout/trunk/math/target/surefire-reports
for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project mahout-math: There are test failures.
Please refer to /home/flora/.linuxbrew/Cellar/mahout/trunk/math/target/surefire-reports for the individual test results.
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: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)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
Please refer to /home/flora/.linuxbrew/Cellar/mahout/trunk/math/target/surefire-reports for the individual test results.
at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:190)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:852)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:720)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :mahout-math

I use Maven 3.3.9, but I can't just use "mvn -DskipTests", it will fail because of lacking lifecycle phase or a goal. Here is error message:
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
There are two methods to ignore unit tests' failures. Use phase install for example:
method 1: mvn -DskipTests install
method 2: mvn -Dmaven.test.skip=true install
The difference between two methods is that the former will compile the unit tests and the latter won't, so the latter can skip compile failure, the former cannot.
Maven Surefire Plugin: Skipping Tests

Related

Maven installing plugin

[INFO] `Scanning for projects`...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] `Building MVNDEMO 0.0.1-SNAPSHOT`
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] `BUILD FAILURE`
[INFO] ------------------------------------------------------------------------
[INFO] `Total time: 0.099 s
[INFO] Finished at: 2019-04-25T12:29:22+05:30
[INFO] Final Memory: 5M/123M`
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "testcases". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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]
You called something like mvn testcases, which is not a valid Maven phase.
If you want to build, use mvn clean install.

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

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.

Maven configuration for Multi Module Project

I am creating a multi-module project with Spring Boot, the project will have 3 modules: moduleA, moduleB and moduleC.
I am following this tutorial https://spring.io/guides/gs/multi-module/#scratch
in the root directory I've created the 3 directories: moduleA, moduleB and moduleC
I've run mvn -N io.takari:maven:wrapper
after I've run sudo ./mvnw and here the result:
MacBook-Pro-de-calzada:multi-module-project-example nunito$ sudo ./mvnw
/Users/nunito/Development/J2EE/workspace-sts-3.8.4.RELEASE/multi-module-project-example
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.066 s
[INFO] Finished at: 2017-04-24T20:03:37+02:00
[INFO] Final Memory: 7M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/NoGoalSpecifiedException
MacBook-Pro-de-calzada:multi-module-project-example nunito$
and executing ./mvnw clean install
/Users/calzada/Development/J2EE/workspace-sts-3.8.4.RELEASE/multi-module-project-example
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.062 s
[INFO] Finished at: 2017-04-24T22:38:20+02:00
[INFO] Final Memory: 8M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/calzada/Development/J2EE/workspace-sts-3.8.4.RELEASE/multi-module-project-example). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
MacBook-Pro-de-calzada:multi-module-project-example nunito$
You need to have a pom.xml file in order to run ./mvnw clean install.
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/calzada/Development/J2EE/workspace-sts-3.8.4.RELEASE/multi-module-project-example).
Have a look at Maven Configuration for Multi Module Project and Maven Configuration for Library in the tutorial. There you will find the necessary pom.xml files.
There are two things :
For running any maven project , the very basic and first requirement is you must have a pom.xml . Absence of this file will throw you the error :
[ERROR] The goal you specified requires a project to execute but there
is no POM in this directory
(/Users/calzada/Development/J2EE/workspace-sts-3.8.4.RELEASE/multi-module-project-example).
Please verify you invoked Maven from the correct directory. -> [Help
1]
In the tutorial https://spring.io/guides/gs/multi-module/#scratch it is mentioned that you should have the pom.xml file , please refer this section ▶Maven Configuration for Multi Module Project

Maven: Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin

I'm trying to create a Web Application Project with Maven as described here but I keep getting the following error
mvn archetype:create
-DgroupId=ru.jofsey
-DartifactId=example
-DarchetypeArtifactId=maven-archetype-webapp
-DinteractiveMode=false
-e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.373 s
[INFO] Finished at: 2017-02-18T14:31:49+03:00
[INFO] Final Memory: 7M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.0 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog -> [Help 1]
org.apache.maven.plugin.MojoNotFoundException: Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.0 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:290)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:238)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
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)
[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/MojoNotFoundException
As per the following release note, the plugin has removed support for the archetype-create goal. It was already marked as deprecated in recent versions of the plugin, and instead you should use the archetype:generate goal. The Jira issue (https://issues.apache.org/jira/browse/ARCHETYPE-437) mentions the following:
It's time to finally remove the support for the old create goal. For users still using it, it should fail the build with a message about using the generate goal instead.
The plugin documentation also removed any mentioning of archetype:create.
Using mvn archetype:generate instance of mvn archetype:create
mvn archetype:generate

Resources