Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unauthorized access on artifactory even though credentials are included

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 ?

like image 984
Abhijith Avatar asked Jul 15 '11 19:07

Abhijith


2 Answers

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.
like image 94
Pmt Avatar answered Oct 18 '22 15:10

Pmt


Hudson is most likely caching settings.xml. You can try to reload configuration from the disk using this url http://your-hudson-url:8081/hudson/reload or restart the container Hudson is running on. Worked for me.

like image 39
Olli Puljula Avatar answered Oct 18 '22 14:10

Olli Puljula