我有下面的maven结构。
亲本Pom
<dependencyManagement>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.27</version>
</dependency>
</dependencyManagement>Service Pom
<parent>
<groupId>com.aliseeks.dependencies</groupId>
<artifactId>AliseeksLive</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
</dependency>
</dependencies>依赖冲突:
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.27:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.25.1:compile
[INFO] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.25.1:compile为什么Maven要引入JerseyCommon 2.25?JerseyClient 2.27显然依赖于JerseyCommon 2.25?这是因为JerseyClient 2.27 POM将${project.version}作为变量,并且它在某种程度上被相关性管理搞砸了吗?
发布于 2018-12-18 14:43:53
泽西-客户端2.27版本取决于泽西-公共2.27版本,如下链接:
https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-client/2.27
但它无疑是在提取2.25版本的jersey--解决了传递依赖后的常见问题,maven发现2.25版本是最近的子版本。这就是它决定推出2.25版本的原因。
为了便于参考,这种类型的依赖冲突问题可以很容易地在maven-enforcer-plugin的帮助下进行研究。下面的链接用示例进一步解释了这个插件的用法:
https://dzone.com/articles/solving-dependency-conflicts-in-maven
https://stackoverflow.com/questions/53825050
复制相似问题