GEODE-781: Match repository id to allow Jenkins to upload Maven artifacts
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0f651c06 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0f651c06 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0f651c06 Branch: refs/heads/feature/GEODE-217 Commit: 0f651c06fe20c4b9f26ed5e76be3ffb2dc8e863a Parents: 6b61d49 Author: Anthony Baker <aba...@apache.org> Authored: Fri Jan 15 11:07:11 2016 -0800 Committer: Anthony Baker <aba...@apache.org> Committed: Sat Jan 16 09:38:02 2016 -0800 ---------------------------------------------------------------------- build.gradle | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0f651c06/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 9160839..524fe00 100755 --- a/build.gradle +++ b/build.gradle @@ -488,7 +488,6 @@ subprojects { // publishing configuration apply plugin: 'com.bmuschko.nexus' - apply plugin: 'maven-publish-auth' extraArchive { sources = true @@ -531,6 +530,17 @@ subprojects { } } + // Jenkins stores auth information in settings.xml. We apply the maven-publish-auth plugin to read that + // from gradle. However, we must match the repository id which the nexus plugin is not exposing. + apply plugin: 'maven-publish-auth' + afterEvaluate { + tasks.getByName('uploadArchives').repositories.mavenDeployer() { + if (project.nexus.snapshotRepositoryUrl) { + repository(id: 'apache.snapshots.https', url: project.nexus.snapshotRepositoryUrl) + } + } + } + // Make precheckin task run all validation tests for checking in code. task precheckin (dependsOn: [ build, integrationTest, distributedTest ]) { description 'Run this task before checking in code to validate changes. This task combines the following tasks: build, integrationTest, and distributedTest' @@ -548,4 +558,3 @@ subprojects { // Make sure clean task for rootProject runs last clean.finalizedBy rootProject.clean } -