Maven fails with forbidden

Issue

  • When performing a deploy on DEV@cloud I receive the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project PROJECT_NAME: Failed to deploy artifacts: Could not transfer artifact COM.REPO.LOCATION.VERSION from/to snapshots (https://USERNAME.forge.cloudbees.com/snapshot/): Access denied to: https://USERNAME.forge.cloudbees.com/snapshot/COM/REPO/LOCATION/VERSION-SNAPSHOT/REPOSITORY.pom, ReasonPhrase: Forbidden. -> [Help 1]
  • Anytime I try to access the SNAPSHOT repository I receive a “Access Denied to:” and “ReasonPhrase: Forbidden” error message.

Environment

DEV@cloud

Resolution

There are 2 common causes of an unauthorized error (403) on CloudBees infrastructure:

  1. Uploading with valid credentials that don’t have authority to the path in question
  2. Uploading with valid credentials to a URL path that doesn’t exist

If the push still fails, then make sure the wagon webdav jackrabbit projects pom.xml as this was a removed dependency from newer maven core versions:

<extensions>
  <extension>
    <groupId>org.apache.maven.wagon</groupId>
    <artifactId>wagon-webdav-jackrabbit</artifactId>
    <version>2.2</version>
  </extension>
</extensions>
Have more questions? Submit a request

1 Comments

  • 1
    Avatar
    Jesse Glick

    Neglects to say that you need to use the extension, by prefixing the repository URL with the dav: prefix.

Please sign in to leave a comment.