Maven version plugin version number

I have a Maven project, which depends on the version Javassist 3.12.1.GA and has 2 repository (in addition to the center): JBoss (https://repository.jboss.org/nexus/content/groups/public) and Java. net (http://download.java.net/maven/2).

The following are the latest available versions of Javassist for the repository:

  • Central: 3.12.1.GA
  • JBoss: 3.12.1.GA (also contains version 3.3, see below)
  • Java.net: 3.3 (only version available)

When I run mvn versions:display-dependency-updates, it says that I can update the Javassist version:

javassist:javassist ......... 3.12.1.GA -> 3.3

This means 3.3 > 3.12.1.GAthat in this particular case it is not true!

How can I tell the version plugin that it should not touch the javassist, or that it should use a different order for this particular dependency?

+3
source share
1 answer

The reason is that Maven treats version numbers that are not in Maven format as a string, and therefore 3.3 is greater than 3.12.1.GA. You can use the -maven-plugin versions and define an exception for javassist (-Dexcludes = javassist: javassist). Or you can write your own version by comparing and using it as a set of rules.

If you use your own repository manager, you can, of course, add the javassist jar manually there with the correct version numbering of Maven, so that the version-maven-plugin will work as intended.

+2
source

All Articles