Maven:不可解析的父 POM

标签 maven module build-automation parent-child

我的 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,无论它是什么模块。

让他们都在 poms 中引用父级。

<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>

最佳答案

仅供引用。

Maven 的乐趣。

将模块的相对路径放入../pom.xml 解决了它。

parent 元素有一个 relativePath 元素,您需要将其指向父目录。默认为 ..

关于Maven:不可解析的父 POM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7612309/

相关文章:

java - 如何对依赖于 Maven 本地存储库的 Java 应用程序进行 Docker 化?

java - 我应该下载 mvnrepository.com 网站的编译依赖项中列出的 jar 吗?

java - Gradle 构建错误 : Failed to appy plugin[class 'org. gradle.api.plugins.JavaPlugin

Magento 翻译在在线程序中正常,但不能作为 cronjob 运行

svn - 从颠覆标签自动构建

windows - 作为构建过程的一部分,如何在 Windows 机器上远程执行命令?

gwt - 使用 GWT-Maven 时如何为 GWT 编译器提供更多内存?

android-maven-plugin 和库项目

java - Maven文件夹布局: Should I place tests in the EAR or its sub-modules?

.net - 编译 .NET 程序集时使用网络模块的用例?