I have configured a Jenkins job to release my maven project automatically. This is done by using the following: mvn --batch-mode clean release:prepare release:perform
You can use build-helper-maven-plugin
. Just add following to pom.xml:
org.codehaus.mojo
build-helper-maven-plugin
${maven.build.helper.plugin.version}
and change command to
mvn --batch-mode clean build-helper:parse-version release:prepare release:perform -DdevelopmentVersion=${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0-SNAPSHOT
(please note that depending on environment you run this command in, you might need to escape $
with \
: \$
)