0

While I was trying to automate the version updates of all the poms in the project, I couldn't fix this issue. The versions:set plugin/command does replace almost every version of a pom but not the versions of the parent pom (another project) defined in the parent part of the pom.xml itself.

<parent>
    <groupId>com.test.app</groupId>
    <artifactId>helloWorld</artifactId>
    <version>3.19.0-SNAPSHOT</version>
    <relativePath />
</parent>

<groupId>com.test.app.child</groupId>
<version>3.21.0-SNAPSHOT</version>
<artifactId>helloWorldChild</artifactId>
<name>${project.groupId}::${project.artifactId}</name>
<packaging>pom</packaging>

As you can see the two versions are different. This is after I executed the following command:

mvn versions:set -DgroupId=com.test.app.* -DartifactId=* -DoldVersion=* -DnewVersion=3.21.0-SNAPSHOT

The expected result is, that both, an all versions versions are 3.21.0-SNAPSHOT instead of 3.19.0-SNAPSHOT. Is there any possibility to fix this?

TheKara
  • 3
  • 2

1 Answers1

1

Your version and group should come from the parent, they should not be set in the child, only the artifact should be set in the child.

<parent>
    <groupId>com.test.app</groupId>
    <artifactId>helloWorld</artifactId>
    <version>3.19.0-SNAPSHOT</version>
    <relativePath />
</parent>

<artifactId>helloWorldChild</artifactId>
<name>${project.groupId}::${project.artifactId}</name>
<packaging>pom</packaging>
TheKara
  • 3
  • 2
Essex Boy
  • 7,565
  • 2
  • 21
  • 24