gpt4 book ai didi

java - Maven parent hierarchy + dependencyManagement 不传递?

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:45:38 24 4
gpt4 key购买 nike

我认为来自 parent 的 dependencyManagement 是可传递的,不是吗?从来没有在文档中明确看到这一点,但对我来说这似乎很明显......

这是我所拥有的:

+-----------------------+
| Parent 1 |
|-----------------------|
| dependencyManagement: |
| lib1: 1.0.0 |
+-----------------------+
^
|
|
+-----------+-----------+
| Parent 2 |
|-----------------------|
| dependencyManagement: |
| lib2: 1.0.0 |
+-----------------------+
^
|
+-----------+-----------+
| Project A |
|-----------------------|
| dependencies: |
| lib1 |
| lib2 |
+-----------------------+

当我尝试 mvn install Project A 时,我得到:

[ERROR]     'dependencies.dependency.version' for lib1-digester:jar is missing. @ line XX, column YY

我还尝试在 Parent 2 的 dependencyManagement 中使用 import 范围添加 Parent 1 的条目,但没有成功。

我的项目 A 如何让版本由其所有父层次结构管理?

最佳答案

看完Maven Docs 看来你是对的.

In general, all dependencies of those projects are used in your project, as are any that the project inherits from its parents, or from its dependencies, and so on.

关于java - Maven parent hierarchy + dependencyManagement 不传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25646754/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com