1
votes

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?

1
try this if it helps - stackoverflow.com/a/49916784/1336292deeshank
Is the version of all childs and in the parent exactly the same if you start mvn release:prepeare ... ?khmarbaise
@khmarbaise I dont understand. The version of the child project is all same. The child project had multiple modules and all these modules are updated with the same version. But in the child project, we mention the parent project artifect. The parent version needs to be updated to the latest snapshot version of the parent project.UKBK

1 Answers

0
votes

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