使用 Maven 管理多重依赖
Managing MultiDependency with Maven
我是 Java 和 maven 的新手。
我有 2 个项目代码(A 和 B),这样。
A依赖B,B依赖C(第三方)
但是项目A也依赖于C。
我可以在A的pom.xml中指定从B中获取C的依赖吗?
我只想在 A 的 pom.xml 中提及对 B 及其 Jars 的依赖。
这样,如果 B 的 pom.xml 中 C 的任何版本发生变化,我就不必在 A
的 pom.xml 中进行相同的更改
Can I specify in pom.xml of A to take the dependency of C from B?
如果A依赖B,B又依赖C,A会传递C的依赖。所以,你不需要在A中声明C,甚至你也不应该避免使用不同的版本。
Transitive dependencies are a new feature in Maven 2.0. This allows
you to avoid needing to discover and specify the libraries that your
own dependencies require, and including them automatically.
我是 Java 和 maven 的新手。 我有 2 个项目代码(A 和 B),这样。 A依赖B,B依赖C(第三方) 但是项目A也依赖于C。
我可以在A的pom.xml中指定从B中获取C的依赖吗?
我只想在 A 的 pom.xml 中提及对 B 及其 Jars 的依赖。
这样,如果 B 的 pom.xml 中 C 的任何版本发生变化,我就不必在 A
的 pom.xml 中进行相同的更改Can I specify in pom.xml of A to take the dependency of C from B?
如果A依赖B,B又依赖C,A会传递C的依赖。所以,你不需要在A中声明C,甚至你也不应该避免使用不同的版本。
Transitive dependencies are a new feature in Maven 2.0. This allows you to avoid needing to discover and specify the libraries that your own dependencies require, and including them automatically.