Created
August 17, 2011 13:52
-
-
Save musketyr/1151565 to your computer and use it in GitHub Desktop.
Gradle to CloudBees configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// some configurations | |
// this is your username, not an email! you can find it | |
// at https://grandcentral.cloudbees.com/account/settings | |
def cloudbeesUsername = 'vlada.appsatori' | |
def cloudbeesPassword = '#!@$***' | |
// this is your account name which could be found | |
// right bellow your username at the same page | |
def cloudbeesAccountName = 'appsatori' | |
apply plugin: 'groovy' | |
apply plugin: 'maven' | |
group = 'eu.appsatori' | |
def versionBase = '0.3.3' | |
// handles releases gracefully | |
gradle.taskGraph.whenReady {taskGraph -> | |
if (taskGraph.hasTask(':release')) { | |
version = versionBase | |
} else { | |
version = versionBase + '-SNAPSHOT' | |
} | |
} | |
repositories { | |
mavenCentral() | |
} | |
configurations { | |
deployerJars | |
} | |
dependencies { | |
// your dependencies | |
// to use WebDav protocol on upload | |
deployerJars "org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-6" | |
} | |
//you probably want to upload javadoc and sources too | |
task packageJavadoc(type: Jar, dependsOn: 'javadoc') { | |
from javadoc.destinationDir | |
classifier = 'javadoc' | |
} | |
task packageSources(type: Jar) { | |
from sourceSets.main.allSource | |
classifier = 'sources' | |
} | |
artifacts { | |
archives(packageJavadoc) { | |
type = 'javadoc' | |
extension = 'jar' | |
} | |
archives(packageSources) | |
} | |
uploadArchives { | |
repositories { | |
deployer = mavenDeployer { | |
// you might use this configuration not to generate | |
// date based artefact names | |
// uniqueVersion = false | |
configureAuth = { | |
authentication(userName: cloudbeesUsername, password: cloudbeesPassword) | |
} | |
configuration = configurations.deployerJars | |
snapshotRepository(url: "dav:https://repository-${cloudbeesAccountName}.forge.cloudbees.com/snapshot/", configureAuth) | |
repository(url: "dav:https://repository-${cloudbeesAccountName}.forge.cloudbees.com/release/", configureAuth) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment