Skip to content

Commit de1b3e9

Browse files
committed
Remove DepencencyManagementPlugin
Issue gh-9540
1 parent 0f0e8ed commit de1b3e9

File tree

15 files changed

+13
-141
lines changed

15 files changed

+13
-141
lines changed

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ ext.snapshotBuild = version.contains("SNAPSHOT")
2424
ext.releaseBuild = version.contains("SNAPSHOT")
2525
ext.milestoneBuild = !(snapshotBuild || releaseBuild)
2626

27-
dependencyManagementExport.projects = subprojects.findAll { !it.name.contains('-boot') }
28-
2927
repositories {
3028
mavenCentral()
3129
}

buildSrc/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ gradlePlugin {
2121
id = "locks"
2222
implementationClass = "lock.GlobalLockPlugin"
2323
}
24+
managementConfiguration {
25+
id = "io.spring.convention.management-configuration"
26+
implementationClass = "io.spring.gradle.convention.ManagementConfigurationPlugin"
27+
}
2428
}
2529
}
2630

@@ -37,7 +41,6 @@ dependencies {
3741

3842
implementation 'com.github.ben-manes:gradle-versions-plugin:0.25.0'
3943
implementation 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.1'
40-
implementation 'io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE'
4144
implementation 'io.spring.gradle:docbook-reference-plugin:0.3.1'
4245
implementation 'io.spring.gradle:propdeps-plugin:0.0.10.RELEASE'
4346
implementation 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15'

buildSrc/src/main/groovy/io/spring/gradle/convention/AbstractSpringJavaPlugin.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public abstract class AbstractSpringJavaPlugin implements Plugin<Project> {
5656
}
5757
pluginManager.apply("io.spring.convention.tests-configuration");
5858
pluginManager.apply("io.spring.convention.integration-test");
59-
pluginManager.apply("io.spring.convention.springdependencymangement");
6059
pluginManager.apply("io.spring.convention.dependency-set");
6160
pluginManager.apply("io.spring.convention.javadoc-options");
6261
pluginManager.apply("io.spring.convention.checkstyle");

buildSrc/src/main/groovy/io/spring/gradle/convention/DependencyManagementExportTask.groovy

Lines changed: 0 additions & 61 deletions
This file was deleted.

buildSrc/src/main/groovy/io/spring/gradle/convention/RootProjectPlugin.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ class RootProjectPlugin implements Plugin<Project> {
5757
}
5858
}
5959

60-
project.tasks.create("dependencyManagementExport", DependencyManagementExportTask)
61-
6260
def finalizeDeployArtifacts = project.task("finalizeDeployArtifacts")
6361
if (Utils.isRelease(project) && project.hasProperty("ossrhUsername")) {
6462
project.ext.nexusUsername = project.ossrhUsername

buildSrc/src/main/groovy/io/spring/gradle/convention/SpringDependencyManagementConventionPlugin.groovy

Lines changed: 0 additions & 54 deletions
This file was deleted.

buildSrc/src/main/groovy/io/spring/gradle/convention/SpringMavenPlugin.groovy

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package io.spring.gradle.convention
22

3-
import io.spring.gradle.dependencymanagement.DependencyManagementPlugin
4-
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
5-
import io.spring.gradle.dependencymanagement.dsl.GeneratedPomCustomizationHandler
6-
import org.gradle.api.Action
73
import org.gradle.api.Plugin
84
import org.gradle.api.Project
95
import org.gradle.api.XmlProvider
@@ -57,9 +53,7 @@ public class SpringMavenPlugin implements Plugin<Project> {
5753
}
5854
}
5955

60-
project.plugins.withType(DependencyManagementPlugin) {
61-
inlineDependencyManagement(project);
62-
}
56+
inlineDependencyManagement(project);
6357

6458
def hasSigningKey = project.hasProperty("signing.keyId") || project.findProperty("signingKey")
6559
if(hasSigningKey && Utils.isRelease(project)) {
@@ -70,9 +64,6 @@ public class SpringMavenPlugin implements Plugin<Project> {
7064
}
7165

7266
private void inlineDependencyManagement(Project project) {
73-
final DependencyManagementExtension dependencyManagement = project.getExtensions().findByType(DependencyManagementExtension.class);
74-
dependencyManagement.generatedPomCustomization( { handler -> handler.setEnabled(false) });
75-
7667
project.install {
7768
repositories.mavenInstaller {
7869
configurePomForInlineDependencies(project, pom)
@@ -89,7 +80,7 @@ public class SpringMavenPlugin implements Plugin<Project> {
8980
pom.withXml { XmlProvider xml ->
9081
project.plugins.withType(JavaBasePlugin) {
9182
def dependencies = xml.asNode()?.dependencies?.dependency
92-
def configuredDependencies = project.configurations.findAll{ it.canBeResolved }*.incoming*.resolutionResult*.allDependencies.flatten()
83+
def configuredDependencies = project.configurations.findAll{ it.canBeResolved && it.canBeConsumed }*.incoming*.resolutionResult*.allDependencies.flatten()
9384
dependencies?.each { Node dep ->
9485
def group = dep.groupId.text()
9586
def name = dep.artifactId.text()

buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.springdependencymangement.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

buildSrc/src/test/resources/samples/showcase/gradle/dependency-management.gradle

Lines changed: 0 additions & 3 deletions
This file was deleted.

buildSrc/src/test/resources/samples/showcase/sgbcs-api/sgbcs-api.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'io.spring.convention.spring-module'
22

33
dependencies {
4+
management platform('io.spring.platform:platform-bom:Brussels-RELEASE')
45
compile 'org.springframework:spring-web'
56
compile 'org.springframework:spring-core'
67
testCompile 'junit:junit'

0 commit comments

Comments
 (0)