【发布时间】:2011-11-28 13:33:04
【问题描述】:
我的 maven 项目设置为 1 个 shell 项目和 4 个子模块。当我尝试构建外壳时。我明白了:
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project module1:1.0_A0 (C:\module1\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find shell:pom:1.0_A0 in http://nyhub1.ny.ssmb.com:8081/nexus/content/repositories/JBoss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
如果我尝试构建一个单独的模块,我会得到相同的错误,只需将 module1 替换为它是什么模块。
让他们都在他们的 pom 中引用父级。
<parent>
<artifactId>shell</artifactId>
<groupId>converter</groupId>
<version>1.0_A0</version>
</parent>
这里是shell pom的相关部分:
<groupId>converter</groupId>
<artifactId>shell</artifactId>
<version>1.0_A0</version>
<packaging>pom</packaging>
<name>shell</name>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
<module>module4</module>
</modules>
【问题讨论】:
-
如果有人感兴趣,在
<parent></parent>下添加<relativePath>..</relativePath>对我有用。 -
运行这个
mvn install -N & mvn install -
当期望模块的父文件夹中的 pom 应该可以访问时,相对路径用于不合格项目而不是“解决方案”。
-
在我的情况下,这是因为 pom.xml 文件中的输入错误。
-
总结所有可能的问题:stackoverflow.com/a/62704660/6172857
标签: maven module build-automation parent-child