Question

The command I'm running is:

mvn -U -e versions:use-latest-versions -Dincludes=com.test.engines:engines -DgenerateBackupPoms=false -DallowMajorUpdates=false -DallowMinorUpdates=false -DallowSnapshots=false

I have, in my pom, a version such as 1.2.3-5-SNAPSHOT and I want to update it to the latest released version. This could be, for example, 1.2.3-7, or 1.2.3-5-SNAPSHOT may not have been released yet meaning the latest version is 1.2.3-4.

When running a maven command on my local Windows machine the versions plugin is working as I require it, however when running it on a remote Linux box (where I really need it to) it doesn't.

My local box shows:

When running a maven command on my local Windows machine the versions plugin is working as I require it, however when running it on a remote Linux box (where I really need it to) it doesn't.

[INFO] [versions:use-latest-versions {execution: default-cli}]
[INFO] Incremental version changes allowed
[INFO] Incremental version changes allowed
[INFO] artifact com.test.engines:engines: checking for updates from central
Props: {project.version=12.4.0-10-SNAPSHOT, project.parent.version=1.0.0, project.parent.groupId=com.test.pom, project.artifactId=edge-web, project.groupId=com.test.edge-web, project.parent.artifactId=pom}
[INFO] Updated com.test.engines:engines:jar:12.4.0-41-SNAPSHOT to version 12.4.0-40
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

Whereas the remote box shows:

[INFO] --- versions-maven-plugin:2.0:use-latest-versions (default-cli) @ edge-web ---
[INFO] Incremental version changes allowed
[INFO] Incremental version changes allowed
[INFO] artifact com.test.engines:engines: checking for updates from nexus
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

When running:

mvn -Dplugin=versions help:describe

The output on both boxes shows the same version number:

Name: Versions Maven Plugin
Description: Versions Plugin for Maven 2. The Versions Plugin updates the
  versions of components in the POM.
Group Id: org.codehaus.mojo
Artifact Id: versions-maven-plugin
Version: 2.0
Goal Prefix: versions

Does anyone know how I can get the same behavior as I do on my local machine? Or have any suggestions as to how I can investigate further?

Was it helpful?

Solution

I was using different versions of Maven. It seems even though the plugin version was the same I guess the method to resolve later versions in the core of maven must be different.

For reference the Mavan version can be checked using:

mvn --version

I also had to do similar to what is described here to allow me to run both Maven 2 and 3 from a single script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top