Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

Enable Maven to push Artifact to Artifactory

This is done in ubuntu 11.10

  1. Open /home//.m2/settings.xml or create the file if it does not exists.
  2. Paste the ff code:

<?xml version="1.0" encoding="UTF-8"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
    http://maven.apache.org/xsd/settings-1.0.0.xsd">  
    <servers>
        <server>
            <id>snapshots</id>
            <username>maven_user</username>
            <password>maven_password</password>
        </server>
        <server>
            <id>release</id>
            <username>maven_user</username>
            <password>maven_password</password>
        </server>
    </servers>
</settings>
Otherwise you'll get the error below:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xxx: 
Failed to deploy artifacts: Could not transfer artifact com.xxx:xxx:pom:0.0.1-20120602.035740-2 from/to snapshots (http://dev.manila.xxx:8081/artifactory/xxx-repo-snapshots): 
Failed to transfer file: http://dev.manila.xxx:8081/artifactory/xxx-repo-snapshots/com/xxx/xxx/0.0.1-SNAPSHOT/xxx-0.0.1-20120602.035740-2.pom. 
Return code is: 401, ReasonPhrase:User anonymous is not permitted to deploy 'com/xxx/xxx/0.0.1-SNAPSHOT/xxx-0.0.1-20120602.035740-2.pom' into 'xxx-repo-snapshots:com/xxx/xxx/0.0.1-SNAPSHOT/xxx-0.0.1-20120602.035740-2.pom'.. -> [Help 1]
Enable Maven to push Artifact to Artifactory Enable Maven to push Artifact to Artifactory Reviewed by Edward Legaspi on Tuesday, May 15, 2012 Rating: 5

No comments:

Powered by Blogger.