Question

I don't know if I just hit a bug in the maven versions plugin or there is something that I'm not understanding... I am using versions:use-latest-releases to update the versions of the dependencies in the pom file, specifying not to allow major updates with -DallowMajorUpdates=false. It seems maven picks up the feature according to the output (see below), but then I does upgrade the major version of Tomcat (see below).

Note: I masked the name of the project, but the rest is verbatim.

C:\>mvn clean versions:use-latest-releases -DallowMajorUpdates=false
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building XXXXXXXXXXX 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ XXXXXXXXXXX ---
[INFO]
[INFO] --- versions-maven-plugin:2.1:use-latest-releases (default-cli) @ XXXXXXXXXXX ---
[INFO] Minor version changes allowed
Props: {project.version=1.0-SNAPSHOT, project.artifactId=XXXXXXX,  project.groupId=xxx.xxx.xxxxxx}
[INFO] Updated org.apache.tomcat:servlet-api:jar:6.0.33 to version 7.0.0.RC3
[... more stuff ...]

Any ideas? Thanks.

Was it helpful?

Solution

I guess this is related to the version number of the servlet-api (7.0.0.RC3) which is not a maven conform version number. Maven and the version plugin expects something like this:

<major version>.<minor version>.<incremental version>-<qualifier>

Version numbers like not matching this also messes up maven version ranges. I do not know how the version number plugin does this, but maven will use String comparison for version numbers not matching the schema and so do not know anything about major and minor versions. See Project Versions.

Maybe you can fix this behavior by using rules for the version plugin and ignoring all versions starting with 7 (see Rules). I never used them so I can not provide any help with this except the documentation.

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