Skip to content

Instantly share code, notes, and snippets.

@cbeams
Created January 2, 2012 15:50
Show Gist options
  • Select an option

  • Save cbeams/1551184 to your computer and use it in GitHub Desktop.

Select an option

Save cbeams/1551184 to your computer and use it in GitHub Desktop.
def repoUser = project.properties['REPO_USERNAME']
def repoPass = project.properties['REPO_PASSWORD']
gradle.taskGraph.whenReady {taskGraph ->
if (taskGraph.hasTask(':artifactoryPublish') &&
(repoUser == null || repoPass == null)) {
logger.warn("WARNING: 'artifactoryPublish' goal specified, but " +
"REPO_USERNAME/REPO_PASSWORD properties have not been provided. " +
"Authorization may fail.")
}
}
artifactory {
contextUrl = 'https://repo.springsource.org'
publish {
repository {
repoKey = 'libs-snapshot-local'
username = repoUser
password = repoPass
}
defaults {
publishConfigs('archives')
properties {
archives "*:*:*:docs@zip", type: 'docs-zip', deployed: 'false'
archives "*:*:*:dist@zip", type: 'dist-zip', deployed: 'false'
archives "*:*:*:schema@zip", type: 'schema-zip', deployed: 'false'
}
}
}
resolve {
repository {
repoKey = 'libs-releases'
username = repoUser
password = repoPass
maven = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment