0

I'm trying to use maven to update to latest minor versions using maven-versions-plugin. The goal use-latest-versions has a flag allowMajorUpdates. But this will set the versions directly in the dependency.

mvn versions:use-latest-versions -DallowMajorUpdates=false

Where I'm located they store version numbers in the properties section of the pom.xml. And they want to keep it that way.

<properties>
    <!-- This should be updated to 1.3, even if 2.0 exists -->
    <an-app-version>1.2</an-app-version>
</properties>
<dependencies>
    <dependency>
        <groupId>com.example</groupId>
        <artifactId>an-app</artifactId>
        <version>${an-app-version}</version>
    </dependency>
</dependencies>

The update-properties goal updates the properties like I want, but I don't want to allow major updates.

mvn versions:update-properties

I'm using maven 3.3.9. Any suggestions?

crea1
  • 11,077
  • 3
  • 36
  • 46
  • What kind of advantage has the usage of a property in such a setup? Why not writing the version directly into the dependency? – khmarbaise May 09 '17 at 08:59
  • @khmarbaise I think the argument is that it gives them an overview quickly of the versions in use. Ufortunately i'm not in the position to change their ways. – crea1 May 09 '17 at 09:07
  • The overview can be seen via Eclipse or other IDE's so you don't need to have the properties as that...but of course the versions-maven-plugin should support that... – khmarbaise May 09 '17 at 11:33
  • @khmarbaise The main advantage is to allow overriding of a version in child projects – Amit Goldstein Apr 16 '20 at 06:15

0 Answers0