Maven"校验和验证失败,预期xxx但是#y;从Jenkins上传到Artifactory

时间:2016-07-15 02:21:33

标签: maven jenkins artifactory

在上传到Artifactory时,使用Maven构建的Jenkins不时会出现校验和验证失败:

[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ example-matcher ---
[INFO] Uploading: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/183/example-matcher-183.pom
[INFO] Uploaded: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/183/example-matcher-183.pom (10 KB at 4.2 KB/sec)
[INFO] Downloading: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml
[WARNING] Checksum validation failed, expected e57ff3c617c84b922d5806a0ba7a9477b274919b but is f64094cf27d28dce9a8fe3fce63dd9c4d113b22a for https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml
[INFO] Downloaded: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml (3 KB at 8.3 KB/sec)
[INFO] Uploading: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml
[INFO] Uploaded: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml (3 KB at 6.2 KB/sec)

任何想法,为什么会发生这种情况以及如何阻止它发生?

2 个答案:

答案 0 :(得分:1)

此警告消息是由Artifactory的校验和验证功能引起的。当文件部署Artifactory时,基于" Checksum Policy"在本地存储库中定义,将验证从客户端发送到Artifactory的校验和,如果校验和不相同,您将收到此警告。

您可以阅读更多关于" Checksum政策" here

答案 1 :(得分:0)

我可能是错的,但是我正在调查相同类型的问题,我的阅读向我表明警告消息不是由于Artifactory抱怨上传的文件校验和,而是由于Maven抱怨了下载的文件maven-metadata.xml文件校验和。

[INFO] Downloading: https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml
[WARNING] Checksum validation failed, expected e57ff3c617c84b922d5806a0ba7a9477b274919b but is f64094cf27d28dce9a8fe3fce63dd9c4d113b22a for https://artifactory.example.com/artifactory/libs-release-local/com/example/test/examplematcher/example-matcher/maven-metadata.xml

(如果这是错误的,我很高兴得到纠正。)因此,我认为部分回答“为什么会这样”,但我还没有弄清楚“如何阻止它发生”。