Maven release: next development version in batch mode

后端 未结 7 2270
一生所求
一生所求 2021-02-19 23:13

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

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-19 23:47

    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 \: \$)

提交回复
热议问题