Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven 'versions' plugin, version number order

Tags:

maven

versions

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

Here are the latest available versions of Javassist per repository:

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

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

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

That means 3.3 > 3.12.1.GA, which, in this specific case, isn't true!

How can I tell the versions plugin that it should not touch javassist, or that it should use another order for this specific dependency?

like image 676
Bruno Reis Avatar asked Nov 17 '25 22:11

Bruno Reis


1 Answers

The cause is, that Maven treats version numbers, which aren't in the Maven format, as string, and therefore 3.3 is bigger than 3.12.1.GA You can use the versions-maven-plugin and define an exclude for javassist ( -Dexcludes=javassist:javassist). Or you can write your own version comparing and use that as ruleset.

If you are running your own repository manager, then you can of course add the javassist jar manually there with a correct Maven version numbering, so that the versions-maven-plugin would work as intended.

like image 186
dunni Avatar answered Nov 21 '25 08:11

dunni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!