Skip to content
Advertisement

Using Maven to deploy release build to Artifactory results in 403 Forbidden but works for snapshots

I’m having an issue deploying my Spring Boot JARs to the company’s internal libs-release-local repository. When I run the mvn deploy:deploy-file command with the appropriate arguments, it deploys successfully from my workstation:

JavaScript

The above repositoryId is defined in my home directory’s settings.xml.

When I run the same command in GitLab CI, I get the following:

JavaScript

Both myself and our service account are configured with the same permissions in the User Management section of Artifactory. Even though I see 403 Forbidden above, the jar file still uploads to Artifactory successfully, however the .jar.md5 and .pom files fail with 403 Forbidden. I don’t see these errors when running within IntelliJ.

Additionally, deploying a SNAPSHOT jar to our snapshot repository completes successfully.

settings.xml

JavaScript

pom.xml

JavaScript

Advertisement

Answer

I ended up using the standard mvn deploy command instead of deploy-file. I’m not sure why, but deploy-file would return HTTP 403 Forbidden whereas deploy publishes the package successfully.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement