Skip to content

Instantly share code, notes, and snippets.

@w4tson
Created October 18, 2013 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w4tson/7039166 to your computer and use it in GitHub Desktop.
Save w4tson/7039166 to your computer and use it in GitHub Desktop.
creates and uploads to maven server a zip archive of config with different classifiers in gradle.
apply plugin: 'maven'
//this is essential! even though not really needed
//there is a bug in gradle whereby if you don't have this it
//just doesn't work
apply plugin: 'java'
repositories {
maven {
url = mavenServer + mavenRepo
}
}
configurations {
fooConfig
}
task zipFooConfigDev(type: Zip) {
classifier = 'dev'
extension = 'zip'
from 'config/dev'
include '**/*'
setBaseName('fooConfig')
destinationDir = file("${buildDir}/distributions")
}
task zipFooConfigProd(type: Zip) {
classifier = 'prod'
extension = 'zip'
from 'config/prod'
include '**/*'
setBaseName('fooConfig')
destinationDir = file("${buildDir}/distributions")
}
artifacts {
fooConfig zipFooConfigDev
fooConfig zipFooConfigProd
}
uploadFooConfig {
repositories {
mavenDeployer {
pom.artifactId = 'fooConfig'
repository(url: mavenServer + mavenReleases){
authentication(userName:repoUsername, password:repoPassword)
}
}
}
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: mavenServer + mavenReleases){
authentication(userName:repoUsername, password:repoPassword)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment