maven - Maven:在下载的项目 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
解决方案
看起来,问题是——
Could not find artifact com.x.nms:integration:pom:15.2.0.19
in central (://repo.maven.apache.org/maven2)
所以,有两件事——
- 您尝试包含在项目中的工件在您指定的存储库路径中不可用。(与错误消息所说的相同)
您可以更改 maven 尝试为此工件查找的存储库路径:从
repo.maven...
, 更改为正确的路径。你可以这样做在本地 pom 中修改路径,
- 或通过编辑位于 .xml 的 settings.xml 文件全局更改它。
m2/settings.xml
. .m2 是一个隐藏文件夹/Users/{yourName}
(windows 和 mac 的位置相同)
- 或通过编辑位于 .xml 的 settings.xml 文件全局更改它。
推荐阅读
- mysql - Homebrew sql@5.7 服务器退出而不更新 Catalina 中的 PID 文件
- python - 如何将默认的 Django 引擎数据库从 db.sqlite3 更改为填充了测试数据的 mysql 数据库?
- reactjs - ReactJS 和 JSX 条件 IF
- javascript - eslint 在将特定文件添加到 ignorePatterns 时忽略所有文件
- angular - 单击另一个组件上的按钮时调用事件
- angular - 角度滑入,滑出动画
- python - 使用相关键规范化 json
- flutter - 在颤动中更新共享首选项列表数据
- python - 异常事件循环在 python 3.8 中使用 aiohttp 和 asyncio 关闭
- javascript - 在 Mapbox 中获取两点之间的方向?