我試圖將pom.xml
文件上載到Artifactory服務器上託管的Maven存儲庫。該pom.xml
的<project>
部分看起來是這樣的:目標部署路徑'...'與POM的預期路徑前綴不匹配
<groupId>com.x.y.z</groupId>
<artifactId>common</artifactId>
<version>2.3.0-RELEASE</version>
<packaging>jar</packaging>
我使用了詹金斯的Artifactory的插件在管道腳本,這裏是uploadSpec
{
"files": [
{
"pattern": "target/common-2.3.0-RELEASE.jar",
"target": "REPOSITORY/com/x/y/z/common/2.3.0-RELEASE/common-2.3.0-RELEASE.jar"
},
{
"pattern": "pom.xml",
"target": "REPOSITORY/com/x/y/z/common/2.3.0-RELEASE/common-2.3.0-RELEASE.pom"
}
]
}
當我現在嘗試上載的神器,我收到以下錯誤信息:
java.io.IOException: Failed to deploy file.
Status code: 409
Response message: Artifactory returned the following errors:
The target deployment path 'com/x/y/z/common/2.3.0-RELEASE/common-2.3.0-RELEASE.pom'
does not match the POM's expected path prefix 'com/x/y/z/common/2.2.7'.
Please verify your POM content for correctness and make sure the source path is a valid Maven repository root path. Status code: 409
我上傳RELEASE
之前,我上傳SNAPSHOT
哪些(在這種情況下)的版本是2.2.7-SNAPSHOT。之後,我將版本升級到2.3.0
,使用mvn clean install
重新構建項目,然後開始另一個上傳到Artifactory。不知何故,當我嘗試上傳新版本時,Artifactory似乎仍期待「舊版」。
編輯
當我上傳的文件與curl
,一切正常:
curl -user:password-T pom.xml \
"http://DOMAIN/artifactory/REPOSITORY/com/x/y/z/common/2.3.0-RELEASE/common-2.3.0-RELEASE.pom"
所以看起來這是關係到詹金斯Artifactory的插件。
提醒自己在管道腳本行家部署:這裏的問題跟蹤https://www.jfrog.com/jira/projects/HAP/issues/HAP-910?filter = allissues –