Releasing artifacts to CloudBees from Gradle

Issue

  • Don’t know how to deploy artifact to CloudBees WebDav repo from Gradle
  • You might be getting Unauthorized (401)

 

Environment

  • DEV@cloud
  • Gradle
  • Maven WebDav repo at CloudBees

 

Resolution

The article below explains how to deploy artifacts on CloudBees with Gradle:

http://www.labouisse.com/how-to/2014/05/23/deploying-artifacts-on-cloudbees-with-gradle/

I personally tested and it works.

This is the build.gradle file I used:

apply plugin: 'java'
apply plugin: 'maven'

group = "net.ggtools.cloudbees"
version = '0.1-SNAPSHOT'

def cloudbeesUsername = "MY_USERNAME"
def cloudbeesPassword = "MY_PASSWORD"

configurations {
    deployerJars
}

repositories {
    mavenCentral()
}

dependencies {
    deployerJars "org.apache.maven.wagon:wagon-webdav:1.0-beta-2"
}

uploadArchives {
    repositories {
        mavenDeployer {
            configuration = configurations.deployerJars
            repository(url: "dav:https://repository-felix.forge.cloudbees.com/snapshot/") {
                authentication(userName: cloudbeesUsername, password: cloudbeesPassword)
            }
        }
    }
}

However, it might not be clear what is the MY_USERNAME and MY_PASSWORD you need to use.

 

MY_USERNAME

In order to get your username you need:

    1. Go to the settings menu -engine button next to your account name.

![account][]

    1. Go to Account Users (Total: X)) You need to be an admin of the account o do this.

![account][]

Pick up for here you User Name under User Name column next to your email address.

MY_PASSWORD

It is the one you use to authenticate at CloudBees under[www.cloudbees.com][]

I think this should be enough information to now be able to deploy to your WebDav repo at CloudBees ;-)

[account]:
[www.cloudbees.com]: http://www.cloudbees.com/

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.