简体   繁体   English

Artifactory Jenkins插件上传的POM文件在Maven版本中无法解析

[英]POM file Uploaded by Artifactory Jenkins plugin won't resolve in Maven builds

I am building a jar in Jenkins and uploading it to an Artifactory repository. 我正在詹金斯(Jenkins)中建立一个罐子,并将其上传到Artifactory存储库。 I've verified the jar, the pom, and the hash files are present in the repository. 我已经验证了jar,pom和哈希文件在存储库中。 When I try to build a project on my machine that has a dependency on the jar, it downloads the jar correctly but then I get a POM file is missing message and the maven build fails. 当我尝试在依赖于jar的计算机上构建项目时,它会正确下载jar,但是随后我收到POM文件丢失消息,并且maven构建失败。 I don't see any rhyme or reason why this should fail, I've done an Artifactory trace on the jar and the pom in Chrome and Firefox and the response says that it found the files. 我看不到任何押韵或原因导致失败的原因,我已经在罐子以及Chrome和Firefox中的pom上进行了Artifactory跟踪,并且响应说它找到了文件。 So I don't understand what could bve causing the issue? 所以我不明白是什么原因引起的? We were running Artifactory 5.2.1 and upgraded over the weekend to 5.5.1, but it hasn't changed anything. 我们在运行Artifactory 5.2.1,并在周末将其升级到5.5.1,但它没有任何改变。 What should I be looking at? 我应该看什么?

Thanks. 谢谢。

EDIT: This question is about to be moot. 编辑:这个问题将是有争议的。 Discussions are in progress about setting up a generic maven repository and avoiding the use of Artifactory altogether, since it won't do what is needed. 关于建立通用Maven存储库并完全避免使用Artifactory的讨论正在进行中,因为它无法满足需要。

First, make sure your groupId and artifactId are correct. 首先,确保您的groupId和artifactId是正确的。 I've lost a lot of time thinking it's a maven problem when it's really just that I reversed a couple letters in a long groupId. 当我真的只是在一个很长的groupId中颠倒了几个字母时,我已经浪费了很多时间来思考这是一个小问题。

Next, have you tried 'forcing' maven to bypass its local cache? 接下来,您是否尝试过“强制” Maven绕过其本地缓存? Try running mvn -U <your tasks> 尝试运行mvn -U <your tasks>

If that doesn't work, try deleting the ~/.m2/repository/path/to/the/artifact/with/the/missing/pom and use mvn -U again 如果这样不起作用,请尝试删除~/.m2/repository/path/to/the/artifact/with/the/missing/pom然后再次使用mvn -U

OK, problem solved. 好,问题解决了。 Turned out to be a Maven problem, not an Artifactory problem. 原来是Maven问题,而不是Artifactory问题。 Our maven settings contain a proxy setting so we can pull down jar from Maven Central - problem was, our company url was incorrectly configured in the nonProxyHosts tag, was set to domain.org, instead of *.domain.org, so it was trying to retrieve the maven artifact through the proxy instead of going directly to the Artifactory server. 我们的Maven设置包含一个代理设置,因此我们可以从Maven Central下拉jar-问题是,我们的公司url在nonProxyHosts标记中配置不正确,设置为domain.org,而不是* .domain.org,因此它正在尝试通过代理检索Maven工件,而不是直接转到Artifactory服务器。 My apologies to the Artifactory devs for blaming the problem on Artifactory. 我向Artifactory开发人员表示歉意,将问题归咎于Artifactory。

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

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