简体   繁体   English

如何更新 maven 中的传递依赖项?

[英]How can I update my transitive dependency in maven?

Lets say I have project P which has dependency on library A and A is depending on library B, so i found bug in B and want to update library by keeping same version of A library, one solution is exclude from A and add dependency again, but what I am looking is it should be done with in tags.假设我有项目 P,它依赖于库 A,而 A 依赖于库 B,所以我在 B 中发现了错误,并希望通过保持相同版本的 A 库来更新库,一种解决方案是从 A 中排除并再次添加依赖项,但我正在寻找的是它应该在标签中完成。

P pom.xml P pom.xml

        <dependency>
            <groupId>A</groupId>
            <artifactId>A</artifactId>
            <version>1</version>
        </dependency>// this version comes with buggy B (version 1 for instance)
        <dependency>
            <groupId>B</groupId>
            <artifactId>B</artifactId>
            <version>2</version>// override the version coming from A
        </dependency>

BUT --> Be sure that A can work with the new version of B....但是 --> 确保 A 可以使用新版本的 B....

Best solution -> FIX B --> Upgrade A with new B --> Upgrade A dependency in P最佳解决方案 -> FIX B -> 使用新 B 升级 A -> 升级 P 中的 A 依赖项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM