Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 415161

Summary: NPE in tycho-versions:set-version
Product: z_Archived Reporter: Andreas Sewe <sewe>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jan.sievers
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Andreas Sewe CLA 2013-08-15 10:58:04 EDT
This just occured to us when trying to bump the version of Eclipse Code Recommenders to 1.0.5-SNAPSHOT:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-versions-plugin:0.18.0:set-version (default-cli) on project org.eclipse.recommenders.parent: Execution default-cli of goal org.eclipse.tycho:tycho-versions-plugin:0.18.0:set-version 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:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.eclipse.tycho:tycho-versions-plugin:0.18.0:set-version 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.eclipse.tycho.versions.pom.GAV.getGroupId(GAV.java:23)
	at org.eclipse.tycho.versions.manipulation.PomManipulator.isGavEquals(PomManipulator.java:154)
	at org.eclipse.tycho.versions.manipulation.PomManipulator.changePlugins(PomManipulator.java:129)
	at org.eclipse.tycho.versions.manipulation.PomManipulator.changeBuild(PomManipulator.java:117)
	at org.eclipse.tycho.versions.manipulation.PomManipulator.applyChange(PomManipulator.java:90)
	at org.eclipse.tycho.versions.engine.VersionsEngine.applyChange(VersionsEngine.java:165)
	at org.eclipse.tycho.versions.engine.VersionsEngine.apply(VersionsEngine.java:142)
	at org.eclipse.tycho.versions.SetMojo.execute(SetMojo.java:78)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	... 20 more

To reproduce:

  git clone http://git.eclipse.org/gitroot/recommenders/org.eclipse.recommenders.git
  cd org.eclipse.recommenders
  mvn -e org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=1.0.5-SNAPSHOT -Pe43

Sorry, don't have the time to turn this into a minimal test case; hope that and the stacktrace are enough to figure out what's going wrong.
Comment 1 Roland Grunberg CLA 2013-08-15 11:22:14 EDT
This looks similar to the issue raised on tycho-user (http://dev.eclipse.org/mhonarc/lists/tycho-user/msg04570.html). If this is the case then the workaround is to either explicitly state the groupid for whichever build plugin is missing it, or use 0.17.0.
Comment 2 Jan Sievers CLA 2013-08-16 03:21:22 EDT

*** This bug has been marked as a duplicate of bug 409912 ***