From 97b018664c72a59b2865bf73a7d30675ae4a516e Mon Sep 17 00:00:00 2001 From: Tony Trinh Date: Thu, 7 Apr 2016 16:13:21 -0500 Subject: [PATCH] :zap: Apply nexus plugin only in root project --- build.gradle | 16 ++++++++-------- gradle/nexus.gradle | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index b224b23478..7e4301a030 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,9 @@ plugins { id 'net.researchgate.release' version '2.3.4' } +apply plugin: 'io.codearte.nexus-staging' // must be in root project +apply from: 'gradle/readme.gradle' + // expose FileUtils to imported Gradle scripts project.ext.FileUtils = org.apache.commons.io.FileUtils @@ -27,9 +30,12 @@ release { } allprojects { + apply plugin: 'java' apply plugin: 'maven' apply plugin: 'nebula.provided-base' apply plugin: 'nebula.optional-base' + apply from: "${rootProject.projectDir}/gradle/nexus.gradle" + apply from: "${rootProject.projectDir}/gradle/docs.gradle" group = 'com.github.tony19' version = "${version}" @@ -38,9 +44,8 @@ allprojects { } subprojects { - apply plugin: 'java' - apply from: '../gradle/analysis.gradle' - apply from: '../gradle/license.gradle' + apply from: "${rootProject.projectDir}/gradle/analysis.gradle" + apply from: "${rootProject.projectDir}/gradle/license.gradle" sourceCompatibility = 1.5 targetCompatibility = 1.5 @@ -82,8 +87,3 @@ subprojects { options.deprecation = true } } - -apply plugin: 'java' -apply from: 'gradle/nexus.gradle' -apply from: 'gradle/readme.gradle' -apply from: 'gradle/docs.gradle' diff --git a/gradle/nexus.gradle b/gradle/nexus.gradle index 7396576934..e0be2ddc93 100644 --- a/gradle/nexus.gradle +++ b/gradle/nexus.gradle @@ -4,8 +4,9 @@ * invoked with `gradle uploadArchives`. */ +// This plugin must be declared in all projects with artifacts +// in order for them to be uploaded to Nexus. apply plugin: 'com.bmuschko.nexus' -apply plugin: 'io.codearte.nexus-staging' modifyPom { project {