'Acces denied deploying artifact to Azure Artifacts using STS4
I have a problem using STS4 deploying artifacts to Azure Artifacts. Using the same config files, I can deploy the artifacts using STS3. I do not modify anything and I cannot deploy anything to Azure, I always receive Access denied error.
My maven settings.xml (working with STS3) :
<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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<servers>
<server>
<id>[FEED_NAME]</id>
<username>[USER_NAME]</username>
<password>[PERSONAL_TOKEN]</password>
</server>
</servers>
</settings>
and the pom.xml distributionmanagement
<distributionManagement>
<repository>
<id>[FEED_NAME]</id>
<url>https://pkgs.dev.azure.com/[ORGANIZATION]/[PROJECT]/_packaging/[FEED]/maven/v1</url>
</repository>
</distributionManagement>
And the pom properties:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>11</java.version>
<spring-cloud.version>Hoxton.SR5</spring-cloud.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
I have seen that the maven installation versions are different from STS3 to STS4. In STS4 in settings>Maven>Installations, I can see in Embedded 3.6.3/1.16.0.20200610-1735and in STS3 3.6.3/1.14.0.20191209-1923but I do not know how to deal with that.
Any idea?
Thank you!!
Solution 1:[1]
Just ran into this.
Be aware that the feed can be set up as Organization or Project feed, so it makes a difference in the url e.g.:
<url>https://pkgs.dev.azure.com/[ORGANIZATION]/[PROJECT]/_packaging/[FEED]/maven/v1</url> or <url>https://pkgs.dev.azure.com/[ORGANIZATION]/_packaging/[FEED]/maven/v1</url>
Also, the [USER_NAME] should be [ORGANIZATION] in your settings.xml.
Also, if you are using eclipse, then the built in Maven has an issue uploading jar files. See answer here: Maven Bintray distribution in Eclipse is not uploading jar files. Error code 401 (Unauthorized) but only for jar packaging?
Using an external Maven source solved the problem for me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rick |
