简体   繁体   中英

mvn release:prepare does not update parent version

When I do mvn release:prepare and confirm all the suggested replacement versions, the commands executes successfully. But when I check the pom.xml, the parent is still pointing to the old version.

Command executed to run the release prepare:

mvn release:clean release:prepare -DautoVersionSubmodules=true -DpushChanges=false

child pom.xml.

   <parent>
        <groupId>com.foo.bar</groupId>
        <artifactId>foo-bar-parent</artifactId>
        <version>1.0.0</version>
    </parent>

parent pom.xml is updated with the new version.

    <groupId>com.foo.bar</groupId>
    <artifactId>foo-bar-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0.1-SNAPSHOT</version>
    <name>foo bar Parent</name>

Maven version:

$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Maven release plugin:

<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>

Can someone one help me what I must do so that mvn release:prepare will update the parent version point to the next snapshot version mentioned in the parent pom.xml?

I found this plugin from Maven which helps to update the parent version.

mvn versions:update-parent -DallowSnapshots=true

Ref : https://www.mojohaus.org/versions-maven-plugin/index.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM