We are trying to get the M2 Release Plugin to deploy released artifacts to our Artifactory server. The configuration in our pom.xml
looks like this
....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
....
<distributionManagement>
<repository>
<id>artifactory</id>
<url>http://example.com/artifactory/jenkins-release</url>
</repository>
</distributionManagement>
Using the Config File Provide Plugin we specified a global settings.xml
with the proper credentials
<settings>
<servers>
<server>
<id>artifactory</id>
<username>jenkins</username>
<password>secret!</password>
</server>
</servers>
</settings>
If we now start a release build on Jenkins, Maven tells us that there it received an HTTP 401 from artifactory
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project example-maven-plugin: Failed to deploy artifacts: Could not transfer artifact com.example.maven.plugins:example-maven-plugin:jar:0.0.9 from/to artifactory (http://example.com/artifactory/jenkins-release): Failed to transfer file: http://example.com/artifactory/jenkins-release/com/example/maven/plugins/example-maven-plugin/0.0.9/example-maven-plugin-0.0.9.jar. Return code is: 401, ReasonPhrase:Unauthorized. -> [Help 1]
In the server logs we see that a user "non_authenticated_user" is trying to do a HTTP PUT request to this URL.
Is there some configuration in Maven or Jenkins we are missing? The credentials are correct and if I use the settings.xml from Jenkins on my local machine everything works as expected.