0

I have a library with version 1.0.0-19 (19 is the Jenkins build number), on next jenkins build the version 1.0.0-20 will be assigend to the library and the artifact will be deployed to a maven repository. Another artifact which is referencing the library in the pom dependency section does not get the last version if I execute versions:use-latest-versions, the dependency version is still 1.0.0-19 instead of 1.0.0-20. Maybe it has to do with the allow* system parameters, there is no property for the build number part.

Any ideas how it could be achieved to get always the last build (1.0.0-19 -> 1.0.0-20)?

desert
  • 11
  • 4
  • What IDe are you using? Is there a config you want to share with us? (allow* system parameters and co.) – Lefty G Balogh Dec 20 '16 at 16:20
  • @LeftyGBalogh I use this maven parameters: `-e versions:update-parent versions:use-latest-versions -Dincludes=:* -DallowMajorUpdates=true -DallowMinorUpdates=true -DallowIncrementalUpdates=true -DallowSnapshots=true` – desert Dec 20 '16 at 16:29
  • were you able to resolve this issue? – timbre timbre Apr 17 '18 at 16:20

1 Answers1

0

Within your pom make sure you are using -

<dependencies>
    <dependency>
        <groupId>some.artifactory.group</groupId>
        <artifactId>artifact-name</artifactId>
        <version>1.0.0-19</version>
    </dependency>
</dependencies>
<!-- please use the appropriate artifact and groupId -->


<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.3</version>
        </plugin>
    </plugins>
</build>

and you are executing the command -

mvn versions:use-latest-releases    

Source - http://www.mojohaus.org/versions-maven-plugin/use-latest-releases-mojo.html

Note - Just in case this also involves SNAPSHOTS, do take care of allowSnapshots and use the command as -

mvn versions:use-latest-releases -DallowSnapshots=true
Naman
  • 27,789
  • 26
  • 218
  • 353
  • it doesn't update anything if build number have changed, which is the point of the OP I think and my problem as well. I.e. if version changed from 1.0.0-xx to 1.0.1-yy versions plugin will update it. but 1.0.0-x to 1.0.0-y is unnoticed. – timbre timbre Apr 17 '18 at 16:19