开发者

Maven 'versions' plugin, version number order

开发者 https://www.devze.com 2023-03-06 18:46 出处:网络
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.

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

开发者_C百科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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消