From b1fed6f7c8314f070833e8dfda86f8d0f112a6c0 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 19 Jan 2017 21:38:51 +0000 Subject: [PATCH] Only apply dependency-management and propdeps-maven to subprojects Previously, the dependency management and propdeps-maven plugins were being applied to all projects. The latter caused a problem with publishing to Artifactory as the buildSrc project now had the propdeps-maven plugin applied to it. This commit removes the logic that was applying the propdeps-plugin to all projects so that it's only applied to subprojects excluding the buildSrc project. The logic that applies the dependency management plugin has been moved to the same location. It is applied after the propdeps-maven plugin as, otherwise, the pom customization does not work correctly and optional dependencies are not included in generated poms. Issue: SPR-15167 --- build.gradle | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 331c959df0..3aedb89395 100644 --- a/build.gradle +++ b/build.gradle @@ -103,10 +103,8 @@ configure(allprojects) { project -> ext.gradleScriptDir = "${rootProject.projectDir}/gradle" apply plugin: "propdeps" - apply plugin: "propdeps-maven" apply plugin: "java" apply plugin: "test-source-set-dependencies" - apply plugin: "io.spring.dependency-management" apply from: "${gradleScriptDir}/ide.gradle" // Kotlin compiler does not support JDK 9 yet, see https://youtrack.jetbrains.com/issue/KT-14988 @@ -178,16 +176,6 @@ configure(allprojects) { project -> maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" } } - dependencyManagement { - imports { - mavenBom "io.projectreactor:reactor-bom:${reactorVersion}" - } - resolutionStrategy { - cacheChangingModulesFor 0, 'seconds' - } - applyMavenExclusions = false - } - dependencies { testCompile("junit:junit:${junitVersion}") { exclude group:'org.hamcrest', module:'hamcrest-core' @@ -262,6 +250,17 @@ configure(allprojects) { project -> configure(subprojects - project(":spring-build-src")) { subproject -> apply plugin: "merge" apply from: "${gradleScriptDir}/publish-maven.gradle" + apply plugin: "io.spring.dependency-management" + + dependencyManagement { + imports { + mavenBom "io.projectreactor:reactor-bom:${reactorVersion}" + } + resolutionStrategy { + cacheChangingModulesFor 0, 'seconds' + } + applyMavenExclusions = false + } configurations { jacoco