Maven:在下载的项目pom上找不到工件

时间:2018-07-08 18:50:00

标签: maven pom.xml parent-pom

从项目中下载pom(我知道它可以在远程构建工具上很好地构建)之后,尝试在本地对其进行测试时出现此错误:

$ mvn clean install -DskipTests
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/x/nms/integration/15.2.0.19/integration-15.2.0.19.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.x.oss.itpf.diagmon.taf:your-testware:2.20.7-SNAPSHOT: Could not find artifact com.x.nms:integration:pom:15.2.0.19 in central (httpepo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.x.oss.itpf.diagmon.taf:ddc-testware:2.20.7-SNAPSHOT (C:\Users\erayfra\Workspace\ddc-testware\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.x.oss.itpf.diagmon.taf:your-testware:2.20.7-SNAPSHOT: Could not find artifact com.x.nms:integration:pom:15.2.0.19 in central (://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

1 个答案:

答案 0 :(得分:1)

看起来像,问题是-

    Could not find artifact com.x.nms:integration:pom:15.2.0.19 
    in central (://repo.maven.apache.org/maven2)

所以,有两件事-

  1. 您要包含在项目中的工件在您指定的存储库路径中不可用。(与错误消息的含义相同)
  2. 您可以将maven试图为此工件找到的存储库路径从repo.maven...更改为正确的路径。您可以通过

    • 在本地pom中修改路径,

      • 或通过编辑位于。 m2/settings.xml 的settings.xml文件进行全局更改。 .m2是/Users/{yourName}下的一个隐藏文件夹 (Windows和Mac都在同一位置)