Created
October 18, 2013 09:44
-
-
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.
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
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