为什么Maven想检查本地存储库中存在的POM的远程可用性

发布于 2025-01-25 17:23:32 字数 1277 浏览 1 评论 0原文

我获得了一个带有另一个用户Maven本地存储库(〜/.m2/repository)的内容的ZIP文件,然后给我一个带有Maven项目的zip文件。

如果我进入项目(com.foo.my.project)并运行mvn -x clean naster无法从Maven Central存储库下载自定义库POM(<代码> com.foo.bar ):

[DEBUG] Reading global settings from /home/user/apache-maven-3.5.2/conf/settings.xml
[DEBUG] Reading user settings from /home/user/.m2/settings.xml
[...]
[DEBUG] Using local repository at /home/user/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/user/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Verifying availability of /home/user/.m2/repository/com/foo/bar/1.0.0/bar-1.0.0.pom from [central (https://repo.maven.apache.org/maven2, default, releases)]
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.foo.my.project:project:4.2.1: Failure to find com.foo:bar:pom:1.0.0 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 wrong local POM @ line 4, column 13

我可以告诉Maven不要尝试检查自定义软件包的远程可用性它仅在本地存储库中存在吗?

I was given a zip file with the content of another user's maven local repository (~/.m2/repository) and then I was given a zip file with a maven project.

If I go into the project (com.foo.my.project) and run mvn -X clean install it fails to download from maven central repository a custom library pom (com.foo.bar):

[DEBUG] Reading global settings from /home/user/apache-maven-3.5.2/conf/settings.xml
[DEBUG] Reading user settings from /home/user/.m2/settings.xml
[...]
[DEBUG] Using local repository at /home/user/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/user/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Verifying availability of /home/user/.m2/repository/com/foo/bar/1.0.0/bar-1.0.0.pom from [central (https://repo.maven.apache.org/maven2, default, releases)]
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.foo.my.project:project:4.2.1: Failure to find com.foo:bar:pom:1.0.0 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 wrong local POM @ line 4, column 13

I can I tell maven to not attempt to check remote availability of a custom package which is only present in local repository?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

属性 2025-02-01 17:23:32

删除file/home/user/.m2/repository/com/foo/bar/1.0.0/_remote.repositories和该文件夹中的任何SHA文件,并重新运行Maven build命令。

Delete the file /home/user/.m2/repository/com/foo/bar/1.0.0/_remote.repositories and any SHA files in that folder and rerun the maven build command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文