![](/img/trans.png)
[英]Shade (relocate) one version of a transitive dependency, but not the other
[英]How can Maven Shade Plugin relocate multiple versions of a transitive dependency?
我有两个依赖项, 工件-a和工件-b 。 每个依赖于工件-c的不同版本。 如何遮挡工件以使用这些不同的依赖关系? (或者让伪像-a使用阴影依赖项, 伪像-b使用普通的依赖项。
<dependency>
<groupId>group-a</groupId>
<artifactId>artifact-a</artifactId>
<version>2.1.0</version>
<!-- artifact-a uses version 3 of artifact-c.
How do I relocate version 3 without conflicting with version 4?
<groupId>group-c</groupId>
<artifactId>artifact-c</artifactId>
<version>3.0.0</version>
-->
</dependency>
<dependency>
<groupId>group-b</groupId>
<artifactId>artifact-b</artifactId>
<version>1.5.0</version>
<!-- artifact-b uses version 4 of artifact-c.
How do I relocate version 4 without conflicting with version 3?
<groupId>group-c</groupId>
<artifactId>artifact-c</artifactId>
<version>4.0.0</version>
-->
</dependency>
这可能可以通过创建新的Maven模块来完成,该模块的唯一目的是遮盖工件-a及其依赖项(分别是工件-b )。 然后,主模块将依赖于这两个新模块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.