为什么Maven想检查本地存储库中存在的POM的远程可用性
我获得了一个带有另一个用户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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除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.