I am trying to configure a common authentication system on a build server. We have several maven projects that state how deployment should be done in relation to the different teams that we have (each team has its own user / password for authentication):
<profile>
<id>release-profile</id>
<distributionManagement>
<repository>
<id>rep-releases</id>
<name>rep-releases</name>
<url>http://somewhere-releases</url>
</repository>
<snapshotRepository>
<id>rep-snapshots</id>
<name>rep-snapshots</name>
<url>http://somewhere-snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
Then I declare authentication in the settings.xml to the declared servers as follows:
<servers>
<server>
<id>rep-releases</id>
<username>${release.user.name}</username>
<password>${release.user.password}</password>
</server>
<server>
<id>rep-snapshots</id>
<username>${release.user.name}</username>
<password>${release.user.password}</password>
</server>
</servers>
Finally, depending on the projects I want to deploy, I have several profiles defined in the settings.xml file of the build server:
<profile>
<id>dep-team1</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<release.user.name>team1-user</release.user.name>
<release.user.password>team1-password</release.user.password>
</properties>
</profile>
The problem is that when I deployed the project, I received an authentication error (HTTP 401) as follows:
Error deploying artifact: Failed to transfer file: http:
If I change the server authentication, replacing the properties with the user / password of the command, everything works fine.
<servers> < > ?
, ?
.
: hudson, maven2 ( /) maven, , ...