【发布时间】:2017-06-13 13:10:52
【问题描述】:
我使用 Jenkins 构建一个 Maven 项目。
我有 Jenkins 凭据插件和 Jenkins Artifactory 插件。
我已在凭据配置中添加了我的 Artifactory 凭据。
我已将 Artifactory 插件配置为使用凭据并设置服务器 URL。测试连接工作并报告它已找到服务器。
我的项目的 POM 为 distributionManagement 部分中的 repository 和 snapshotsRepository 指定了正确的 Artifactory 路径。
我的 Jenkins 项目构建配置为执行 mvn deploy。
在我的本地构建中,我可以从我的开发机器部署到 Artifactory 服务器(我已在 settings.xml 中配置了凭据。
但是,在我的 Jenkins 工作中,我想使用 Artifactory 插件和 Credentials 插件中的 Credentials。当我构建时,我得到以下内容
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://xxxxx/artifactory/libs-release-local
Uploading: http://xxxxx/artifactory/libs-release-local/xxx/3.01/xxx-3.01.war
Uploading: http://xxxxx/artifactory/libs-release-local/xxx/3.01/xxx-3.01.pom
Notifying upstream projects of job completion
Join notifier requires a CauseAction
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
以及下面的堆栈跟踪
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project querynator:
Failed to deploy artifacts: Could not transfer artifact xxx:war:3.01 from/to dwCentral (http://xxxxx/artifactory/libs-release-local):
Failed to transfer file: http://xxxxx/artifactory/libs-release-local/xxx/3.01/xxx-3.01.war.
Return code is: 401, ReasonPhrase: .
这表明问题出在凭据上,特别是因为我可以从我的开发箱部署(使用 settings.xml 中的凭据),但不能从 Jenkins 部署。
我已尝试部署新版本。我尝试过部署快照。这不是版本问题。
我该如何解决这个问题?如何进一步解决此问题?
【问题讨论】:
标签: maven jenkins artifactory