我试图将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 –