I´m trying to configure my maven to use a Nexus repository. What I´m trying to achieve should be very common: I want to have a Nexus repository working as a proxy for central dependencies and also two repositories for snapshots and releases. There´s plenty of documentation out there, but I am not able to get it running. I edited my settings.xml so that it looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0
http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository>${M2_REPO}</localRepository>
<servers>
<server>
<id>nexus</id>
<username>myuser</username>
<password>mypass</password>
<url>https://snapshoturl</url>
</server>
<server>
<id>nexus-releases</id>
<username>myuser</username>
<password>mypass</password>
<url>https://releaseurl</url>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<url>https://groupurl</url>
<username>myuser</username>
<password>mypass</password>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>myprofile</id>
<repositories>
<repository>
<id>nexus</id>
<url>https://snapshoturl</url>
<username>myuser</username>
<password>mypass</password>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<!--<repository>
<id>nexus-releases</id>
<url>https://releaseurl</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>-->
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://groupurl</url>
<username>myuser</username>
<password>mypass</password>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>myprofile</activeProfile>
</activeProfiles>
</settings>
But I always get the following error message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-
plugin:2.7:deploy (default-deploy) on project share.logging: Failed to
retrieve remote metadata xxx:share.logging:1.0.0-SNAPSHOT/maven-
metadata.xml: Could not transfer metadata
xxx:share.logging:1.0.0-
SNAPSHOT/maven-metadata.xml from/to p19dai-internal (https://snapshoturl):
Not authorized , ReasonPhrase:Authorization Required. -> [Help 1]
Can anyone help me here? What am I missing?