4

I am using the Tycho plugin to compile an Eclipse plugin project. When I run the command

mvn clean install my build passes

When I run the command

mvn clean verify install my build fails with the following:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:1.1.0:
p2-metadata-default (default-p2-metadata-default) on project 
com.mysite.project: 
Execution default-p2-metadata-default of goal 
org.eclipse.tycho:tycho-p2-plugin:1.1.0:p2-metadata-default failed. 
IllegalArgumentException -> [Help 1]

The failure stacktrace is:

    at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.getCanonicalArtifact(P2GeneratorImpl.java:193)
    at org.eclipse.tycho.p2.impl.publisher.P2GeneratorImpl.generateMetadata(P2GeneratorImpl.java:146)
    at org.eclipse.tycho.plugins.p2.P2MetadataMojo.attachP2Metadata(P2MetadataMojo.java:149)
    at org.eclipse.tycho.plugins.p2.P2MetadataMojo.execute(P2MetadataMojo.java:108)
    at org.eclipse.tycho.plugins.p2.P2MetadataDefaultMojo.execute(P2MetadataDefaultMojo.java:33)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    ... 21 more

From everything I can find on Maven, invoking the install phase should implicitly trigger the verify phase. What's going on here?

T.D. Smith
  • 984
  • 2
  • 7
  • 22
  • maybe help : https://stackoverflow.com/questions/16602017/how-are-mvn-clean-package-and-mvn-clean-install-different?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Abdo Bmz Apr 27 '18 at 21:46
  • 1
    Is this Eclipse bug relevant?... [Bug 428950 - IllegalArgumentException thrown by P2GeneratorImpl.getCanonicalArtifact when generating p2 metadata with P2MetadataMojo](https://bugs.eclipse.org/bugs/show_bug.cgi?id=428950) – skomisa Apr 28 '18 at 00:42
  • @skomisa I checked the cause described in that ticket (syntactically correct, semantically incorrect) but that does not appear to be the issue. – T.D. Smith May 01 '18 at 01:06
  • 1
    Each phase you list will run the build lifecycle up to and including that phase. So "mvn verify install" will effectively do "mvn verify" followed by "mvn install", meaning that (much of) the build lifecycle will execute twice. Does "mvn clean verify" pass? Does "mvn clean verify verify" pass? – ctrueden May 22 '18 at 14:56

1 Answers1

4

personally, i never use mvn install when using tycho, because it will install the bundles into your local repo, and since you're build eclipse bundles, you do not have to push them to your maven repo. back to your question, calling two phases in a single command is not necessary since the install phase should trigger the verify phase.

so use only mvn verify to build your product or only mvn install to achieve the exact same goal ( and have the built artifact pushed into your local repo )

sbouchet
  • 356
  • 3
  • 7