unauthorized access on artifactory even though credentials are included

Abhijith picture Abhijith · Jul 15, 2011 · Viewed 39k times · Source

I am trying to deploy a zip file to a remote inhouse maven repo.(artifactory integrated into hudson).

pom.xml

...
<modelVersion>4.0.0</modelVersion>

<groupId>mygroupId</groupId>
<artifactId>myartifactid</artifactId>   

<version>1.0-SNAPSHOT</version>

<distributionManagement>
    <repository>
      <id>hudson</id>
      <name>hudson-releases</name>
      <url>http://url to repo</url>
    </repository>
  </distributionManagement>
...

settings.xml

<servers>
<server>
  <id>hudson</id>
  <username>username</username>
  <password>password</password>
</server>
</servers> 

maven deploy

 mvn deploy:deploy-file -Durl=http://url -Dfile=file-1.0.0.zip  -Dpackaging=zip  -DpomFile=pom.xml

maven quits with return code 401.

Looking at artifactory's logs

 2011-07-15 13:52:50,090 [DENIED DEPLOY] libs-release-local:somefile.zip for anonymous/192.168.220.146.

I don't understand why maven doesn't use the supplied credentials. What am i doing wrong here ?

Answer

Pmt picture Pmt · Mar 8, 2013

Tip to solve the problem with the clear text password:

  • Access and login into Artifactory.
  • Once you are logged in, click over your user name, on the superior right corner of the screen.
  • Put your password then clique in the em Unlockbutton, enabling the encrypted password.
  • Copy the tag that will be showed on the inferior part of the screen and paste it into the settings.xml file. If you prefer to just copy the password, be sure about let it exactly equals the tag showed below, including the "\" at the beginning of the password.
  • Remember to adjust the tag with the id of your server, defined into the tag, in your POM.xml
  • Click in Update button and ready! Check if everything will occur well at the next project's publication.