2

Let's consider I have a dependency in my pom.xml like this :

<dependency>
  <groupId>mygroupid</groupId>
  <artifactId>myartifactid</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>

For each build, I'd like the version of this dependency to be updated if the release exists. Thus, I expect the version to be updated from 1.0-SNAPSHOT to 1.0, even if version 2.0 has been released.

It's possible with Versions Maven Plugin, executing mvn versions:use-releases. Fine.

Now, the version is set in a property. The pom.xml looks like this :

<dependency>
  <groupId>mygroupid</groupId>
  <artifactId>myartifactid</artifactId>
  <version>${my.version}</version>
</dependency>

<properties>
  <my.version>1.0-SNAPSHOT</my.version>
</properties>

Same as before, I'd like like the version of this dependency to be updated if the release exists.

It looked possible with the same Versions Maven Plugin, executing mvn versions:update-properties. But, with this goal, the version is updated to the last release available (e.g. 2.0 in our case) instead of 1.0.

Any idea of how to get the same behavior as use-release goal with update-properties goal ?

  • 1
    I asked the same thing some time ago, https://stackoverflow.com/q/54940280/927493, but unfortunately no helpful answers... – J Fabian Meier Mar 19 '20 at 10:28

0 Answers0