I use Jenkins to build a Maven project.
I have the Jenkins Credentials Plugin and the Jenkins Artifactory Plugin.
I have added my Artifactory credentials in the Credentials config.
I have configured the Artifactory plugin to use the Credentials and have set up the server URL. Test Connection works and reports back that it has found the server.
My project's POM specifies the correct Artifactory paths for the repository
and the snapshotsRepository
in the distributionManagement section.
My Jenkins project build is configured to do a mvn deploy
.
In my local build, from my development machine, I can deploy to the Artifactory server (I have configured the credentials in my settings.xml
.
However, in my Jenkins job, I want to use the Artifactory plugin and the Credentials int he Credentials plugin. When I build, I get the following
[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] ------------------------------------------------------------------------
and the following stack trace
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: .
This indicates to me the issue is with credentials, particularly since I can deploy from my dev box (using credentials in settings.xml), but not from Jenkins.
I have tried deploying a new version. I have tried deploying snapshots. This is not a version issue.
How can I I resolve this? How can I troubleshoot this further?