【发布时间】:2016-11-24 09:55:04
【问题描述】:
Eclipse 一直告诉我它找不到我的项目的父 pom,但如果我从 Eclipse 对我的项目运行 mvn -U install,则构建工作正常。
我正在使用 Eclipse Neon.1 Release (4.6.1),并将其配置为使用我的外部 maven,即 maven 3.3.9。
这是 Eclipse 显示给我的确切标记:
Project build error: Non-resolvable parent POM for nl.travelcard.common:tc-parent-fuse:2.1-SNAPSHOT: Failure to find nl.travelcard.common:tc-parent:pom:12 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at no local POM
这是我的 pom 中的父标签:
<parent>
<artifactId>tc-parent</artifactId>
<groupId>nl.travelcard.common</groupId>
<version>12</version>
</parent>
【问题讨论】:
-
你确定你的父 dep 在 maven Central 中可用,因为我找不到它search.maven.org/#search%7Cga%7C1%7Cnl.travelcard.common
-
不是。它在我们的 nexus 服务器中,它已经在我的 settings.xml 中进行了配置,并且 maven 可以找到它,因为 maven 构建实际上可以工作。从 Eclipse 和命令行。这就是整件事的奇怪之处。
-
您是否在 Eclipse 中配置了这 2 件事:窗口 -> 首选项 -> Maven -> 安装并拥有自己的 Maven 发行版。还有 Window->Preferences->Maven->User Settings 并在全局设置中有你自己的 maven distrib 当前使用的设置文件?
-
我没有设置全局设置,没有。但是将其设置为默认值,/conf/settings.xml 似乎已经触发 Eclipse 意识到 maven 构建没有问题。所以现在标记不见了,去看看。感谢您的帮助,@colin。如果您想创建一个答案,我会将其标记为正确。
标签: eclipse maven repository parent-pom dependency-resolution