Reputation: 621
I´m using Artifactory 2.4.0 and Jenkins 1.438 and I have maven project with several modules. Need to deploy all modules(jars and one resulting war) into remote Artifactory server by Jenkins.
My user admin for artifactory was with default password (password) and all builds that I tried to execute on jenkins works fine. So when I resolved to change de Artifactory admin password and update my settings with the new credentials of admin, I had the following error on jenkins build log:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project pilotoExemplo: Failed to deploy artifacts:
Could not transfer artifact br.com.pilotoExemplo:pilotoExemplo:pom:2.1.0.11-20120705.160113-1 from/to snapshot
({ip_server}/artifactory/libs-snapshot-local): Failed to transfer file:
{ip_server}/artifactory/libs-snapshot-local/br/com/pilotoExemplo/pilotoExemplo/2.1.0.11-SNAPSHOT/pilotoExemplo-2.1.0.11-20120705.160113-1.pom.
Return code is: 401
Anyone already saw this problem before? I don´t found anything like this search on the google.
Here is my settings.xml:
<mirrors>
<mirror>
<mirrorOf>*</mirrorOf>
<name>repositorio</name>
<url>{ip_server}/artifactory/repo</url>
<id>repositorio</id>
</mirror>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>{ip_server}/artifactory/libs-release/</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>{ip_server}/artifactory/libs-snapshot/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>{ip_server}/artifactory/plugins-release</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
<distributionManagement>
<repository>
<id>release</id>
<url>{ip_server}/artifactory/libs-release-local/</url>
</repository>
<snapshotRepository>
<id>snapshot</id>
<url>{ip_server}/artifactory/libs-snapshot-local/</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
<servers>
<server>
<id>snapshot</id>
<username>admin</username>
<password>newPassword</password>
</server>
<server>
<id>release</id>
<username>admin</username>
<password>newPassword</password>
</server>
<server>
<id>repositorio</id>
<username>admin</username>
<password>newPassword</password>
</server>
</servers>
Upvotes: 1
Views: 4816
Reputation: 1152
Tip to solve the problem with the clear text password:
Upvotes: 1
Reputation: 9776
As far as I know Jenkins jobs can have their own M2 repository, or they use the repository of the user. So the answer could be, that your jenkins is running as a service (maybe as local system account), and not in the name of your user.
You can check the user name at the Jenkins setting/system information page (yourcontextroot/systemInfo). So basicly the solution is to put the same settings file for the running user, like you have.
Upvotes: 1