I am trying to release code using Jenkins. I have x.x-SNAPSHOT
at master, and I am using master for my release.
release:prepare release:perform -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION
I am using the above command in my jenkins build step. However, my problem is the release plugin is always releasing x.x-SNAPSHOT
to my repository. Can you please highlight what am I doing wrong?
This was the reference for me : http://maven.apache.org/maven-release/maven-release-plugin/examples/non-interactive-release.html
Edit : My bad, missed mentioning few details :
DEVELOPMENT_VERSION 2.1-SNAPSHOT
RELEASE_VERSION 2.1
I am injecting these variables and I have confirmed after the execution that these values are getting injected indeed.
[INFO] ------------------------------------------------------------------------
[INFO] Building app 2.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.3.2:prepare (default-cli) @ app ---
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: **/pom.xml.releaseBackup, **/pom.xml.next, **/pom.xml.tag, **/pom.xml.branch, **/release.properties, **/pom.xml.backup
[INFO] Executing: /bin/sh -c cd /data/jenkins/workspace/app-master && git status
[INFO] Working directory: /data/jenkins/workspace/app-master
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] Transforming 'app'...
[INFO] Not generating release POMs
[INFO] Executing goals 'clean verify'...
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building app 2.1
[INFO] [INFO] ------------------------------------------------------------------------
This is when I run release:prepare. Then the tag is checked out:
[INFO] --- maven-release-plugin:2.3.2:perform (default-cli) @ app ---
[INFO] Checking out the project to perform the release ...
While performing release:
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building app 2.1-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------
And the tag does have <version>2.1-SNAPSHOT</version>