I've been trying for almost a day now to deploy jar files from Jersey to our local Artifactory using Maven. I have made a few small changes to branch 2.6.x of Jersey and have built and packaged the jars. Here is the excerpt of parent pom from Jersey:
<groupId>org.glassfish.jersey</groupId>
<artifactId>project</artifactId>
<packaging>pom</packaging>
<version>2.6.rn-SNAPSHOT</version>
<name>jersey</name>
<description>
Jersey is the open source (under dual CDDL+GPL license) JAX-RS 2.0 (JSR 339)
production quality Reference Implementation for building RESTful Web services.
</description>
<distributionManagement>
<repository>
<id>central</id>
<name>central-repo</name>
<url>http://localhost/artifactory/libs-releases-local</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>central-repo-snapshots</name>
<url>http://localhost/artifactory/libs-snapshots-local</url>
</snapshotRepository>
</distributionManagement>
I have my settings.xml
generated by artifactory and placed in ~/.m2/settings.xml
But when I try to deploy using mvn deploy
, I get the following:
Uploading: (https: //maven.java.net/content/repositories/snapshots/): Failed to transfer file: https://maven.java.net/content/repositories/snapshots/org/glassfish/jersey/project/2.6.rn-SNAPSHOT/project-2.6.rn-20150218.212627-1.pom. Return code is: 401, ReasonPhrase: Unauthorized.
My complete settings.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>admin</username>
<password>admin</password>
<id>central</id>
</server>
<server>
<username>admin</username>
<password>admin</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-releases</name>
<url>http://localhost/artifactory/libs-releases</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshots</name>
<url>http://localhost/artifactory/libs-snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-releases</name>
<url>http://localhost/artifactory/plugins-releases</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshots</name>
<url>http://localhost/artifactory/plugins-snapshots</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>