Search code examples
mavenhudsonartifactory

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 ?


Solution

  • For some reason using a POM file didn't work. So i had to do it from command line.

    mvn deploy:deploy-file -Durl=http://url -Dfile=file-1.0.0.zip  -Dpackaging=zip  -DartifactId=aid -DgroupId=groupId -DrepositoryId=repId -Dversion=1.0-SNAPSHOT
    

    I still do not know why this worked. Also , i didn't have to change settings.xml from what i listed before.

    EDIT

    Also, on the home tab in artifactory, you can get maven settings by clicking "Maven settings->Generate Settings" .