Jay
Jay

Reputation: 20136

Maven error: "You don't have a SNAPSHOT project in the reactor projects list."

What on earth does this mean? Cant find any help via google.

>  mvn release:prepare
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Base 1.0.5
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-release-plugin:2.3.2:prepare (default-cli) @ base ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.386s
[INFO] Finished at: Tue Oct 08 08:22:46 EST 2013
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project base: You don't have a SNAPSHOT project in the reactor projects list. -> [Help 1]

Upvotes: 13

Views: 42470

Answers (5)

eis
eis

Reputation: 53502

release:prepare command is supposed to prepare your snapshot project for the release. It sounds like you don't have such a snapshot project.

Here's the full details what it'll do: http://maven.apache.org/maven-release/maven-release-plugin/examples/prepare-release.html

If you're sure you should be releasing, you should be working on a maven module that has version ending with -SNAPSHOT.

Update: like noted by @khmarbaise in the comments, if your release has failed, you should do release:rollback to go back to previous state. Note though that it is not supported if you release through jenkins (jenkins issue), and it won't rollback the tags.

Upvotes: 18

TomaszZ.
TomaszZ.

Reputation: 9

No need to update versions manually as that is time consuming, if version change is all you need, there is a different command that only updates the pom versions, just like updating them manually:

mvn versions:set -DgenerateBackupPoms=false -DnewVersion=1.0.XX-SNAPSHOT

Upvotes: 0

nmishin
nmishin

Reputation: 3044

Don't needed manually edit pom.xml. You can use "mvn versions:set" for batch update, something like this:

mvn versions:set -DnewVersion=1.0.3-SNAPSHOT

Upvotes: 8

Cristan
Cristan

Reputation: 14105

I've had the same error with Jenkins. In a previous release, Jenkins updated the version of the POM to a non-snapshot version, but the build failed before Jenkins could set the version to a -SNAPSHOT version again. Afterwards, making a release resulted in the error described above.

Fixing this is easy: just manually change the version of your app in pom.xml to a -SNAPSHOT version.

Upvotes: 4

Stuart
Stuart

Reputation: 3356

I know this is an old question but I had this issue recently and I found 2 solutions that others may find useful. I am using bamboo as my CI tool. The issue was that there was an error in the bamboo build leaving bamboo in an incorrect state. It had locally updated my project pom.xml with the new release version but had not checked this into SVN. The two solution that worked for me were:

Either

  1. Delete the bamboo build-dir directory for the project and run the release again: rm -rf /opt/bamboo-home/xml-data/build-dir/PROJECT_NAME-RELEASE-JOB1

OR

  1. Run the maven release from the command line using the following commands:

    mvn release:prepare -DignoreSnapshots -Dresume=false

    mvn release:perform

Upvotes: 1

Related Questions