简体   繁体   English

Jenkins无法解决依赖关系

[英]Jenkins could not resolve dependencies

I have a problem with jenkins version 1.500. 我有jenkins版本1.500的问题。 i am trying to build a project with a dependency to another project of mine. 我正在尝试建立一个依赖于我的另一个项目的项目。 The error is: 错误是:

[ERROR] Failed to execute goal on project projectname: Could not resolve dependencies for project projectname:jar:1.0.0: Failure to find reference-project:jar:1.0.0 in http://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 -> [Help 1]

If I build this project via console and Maven, the whole projects build succeed. 如果我通过控制台和Maven构建这个项目,整个项目构建成功。 I checked the dependency jar file in the repository, it is there at the right place. 我检查了存储库中的依赖jar文件,它位于正确的位置。

Does Maven have a own repository or did I miss something? Maven有自己的存储库还是我错过了什么?

But under the Jenkins system settings, I chose "Default(~/.m2/repository)" and I did not check the checkbox "use own repository" at the project settings. 但是在Jenkins系统设置下,我选择了“Default(〜/ .m2 / repository)”,我没有在项目设置中选中“使用自己的存储库”复选框。 Any ideas? 有任何想法吗?

UPDATE I created a extra job for the dependency in jenkins and called the Maven goal install and then everything works fine. 更新我为jenkins中的依赖创建了一个额外的工作并调用了Maven目标安装,然后一切正常。 Before this step I installed the dependency via Console and mvn install. 在此步骤之前,我通过Console和mvn install安装了依赖项。 Why is there a difference? 为什么会有区别? (i tried the given solution with delete and reinstall, but this did not help) (我尝试删除并重新安装给定的解决方案,但这没有帮助)

Simple solution delete the folder from the ~/.m2/repository which represents the artifact you've written about. 简单的解决方案从〜/ .m2 / repository中删除该文件夹,该文件夹代表您编写的工件。 ~/.m2/repository/${groupId}/... and rebuild. 〜/ .m2 / repository / $ {groupId} / ...并重建。 That happens sometimes if you have some problems during download of the artifact etc. 如果您在下载工件等时遇到一些问题,有时会发生这种情况。

我也有类似的问题,并尝试删除〜/ .m2 / repository /中的文件夹,现在它仍然从远程存储库位置下载依赖项到本地

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM