128

I'm using SVN, Maven 3.0.3 on the latest version of Jenkins and the Maven Release plugin. I'm trying to use the Maven release plugin (through Jenkins) do a dry run and so am executing the options …

Executing Maven:  -B -f /scratch/jenkins/workspace/myproject/myproject/pom.xml -DdevelopmentVersion=53.0.0-SNAPSHOT -DreleaseVersion=52.0.0 -Dusername=***** -Dpassword=********* -DskipTests -P prod -Dresume=false -DdryRun=true release:prepare

But the dry run is dying with the error below …

[JENKINS] Archiving /scratch/jenkins/workspace/myproject/myproject/pom.xml to /home/evotext/hudson_home/jobs/myproject/modules/org.mainco.subco$myproject/builds/2013-11-18_16-09-14/archive/org.mainco.subco/myproject/52.0.0/myproject-52.0.0.pom
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: You don't have a SNAPSHOT project in the reactor projects list.
cause : You don't have a SNAPSHOT project in the reactor projects list.
    Stack trace : 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal  org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: You don't have a SNAPSHOT project in the reactor projects list.
    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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
    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.launchStandard(Launcher.java:329)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
    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 hudson.maven.Maven3Builder.call(Maven3Builder.java:129)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:67)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoFailureException: You don't have a SNAPSHOT project in the reactor projects list.
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:219)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:181)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 30 more
Caused by: org.apache.maven.shared.release.ReleaseFailureException: You don't have a SNAPSHOT project in the reactor projects list.
    at org.apache.maven.shared.release.phase.CheckPomPhase.execute(CheckPomPhase.java:111)
    at org.apache.maven.shared.release.phase.CheckPomPhase.simulate(CheckPomPhase.java:123)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:199)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140)
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103)
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:211)
    ... 33 more

My SVN checkout method is set to "Always checkout a fresh copy" and I have a snapshot version in question in my snapshot repository, but not in my release repository. Is there a way I can get the "reactor projects list" to look at my snapshot repo?

Edit: I'm including the snippet of my pom where the project gets its version -- it inherits it from a parent

    <parent>
            <artifactId>subco</artifactId>
            <groupId>org.mainco.subco</groupId>
            <version>52.0.0</version>
    </parent>
2

4 Answers 4

185

You're trying to release an artifact that's not a snapshot. That means your artifact's version number is something like 3.0.3. That version number implies its already been released. You can't release a release. There would be no changes in between and therefore no point.

You're only supposed to release SNAPSHOT versions. That means your version number would be like 3.0.3-SNAPSHOT.

6
  • 1
    I added how I'm getting my version -- I'm inheriting it from a parent pom. Sadly if I change the version to include "-SNAPSHOT," I get the error, "Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project myproject: Can't release project due to non released dependencies"
    – Dave
    Commented Nov 18, 2013 at 21:24
  • @Dave I think you'll have to make the parent a snapshot, too. Commented Nov 18, 2013 at 21:37
  • I may need to open a second SO question about this, but the parent pom does have a SNAPSHOT version, although it is "53.0.0-SNAPSHOT" (instead of what I'm trying to inherit from, 52.0.0-SNAPSHOT). Were you referring to changing the version in the parent pom?
    – Dave
    Commented Nov 19, 2013 at 16:34
  • 1
    I think the error message is not self explanatory unless you know what "reactor projects list" means. Thanks for the very clear answer.
    – user1026870
    Commented Apr 23, 2014 at 22:04
  • 14
    It would be so much easier to understand if they would just add a message like "You can't release a release. ". The message that they come up with is "You don't have a SNAPSHOT project in the reactor projects list." ... Who will ever interpret this message the way it is supposed to? Commented Aug 6, 2015 at 22:18
9

Jenkins workspace is not cleanup or you have FINAL version inside pom.xml. Jenkins has check-out strategy for cleaning up workspace.

More: Maven release plugin - SNAPSHOT project needed

Check-out Strategy options:

  • Emulate clean checkout by first deleting unversioned files/ignored files, as well as files/directories ignored by svn:ignore, then execute svn update.
  • Always check out fresh copy
  • Use svn update as much possible, with svn revert before update
3
  • What do you mean by "Jenkins has options for cleaning up workspace"? Where are these options? Are you talking about the workspace cleanup plugin for Jenkins?
    – Dave
    Commented Nov 18, 2013 at 19:27
  • Check-out Strategy options
    – MariuszS
    Commented Nov 18, 2013 at 20:10
  • 1
    for me this was the case, after clearing jenkins workspace it worked.
    – rbhawsar
    Commented Sep 13, 2017 at 9:31
2

Bump Up your Project POM file for from the previously built code base to a new version.

1.0.1-SNAPSHOT<version>1.0.1-SNAPSHOT</version>

0

Changing the check-out strategy to "Emulate clean checkout by first deleting unversioned files/ignored files, then svn update" did the trick for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.