diff --git a/bom/spring-security-bom.gradle b/bom/spring-security-bom.gradle index 7b57927169..68b4eee5e7 100644 --- a/bom/spring-security-bom.gradle +++ b/bom/spring-security-bom.gradle @@ -1,4 +1,13 @@ +import io.spring.gradle.convention.SpringModulePlugin + apply plugin: 'io.spring.convention.bom' -sonarqube.skipProject = true - +dependencies { + constraints { + project.allprojects { p -> + p.plugins.withType(SpringModulePlugin) { + api p + } + } + } +} diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/MavenBomPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/MavenBomPlugin.groovy index d2e973b511..d36325adc9 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/MavenBomPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/MavenBomPlugin.groovy @@ -2,6 +2,7 @@ package io.spring.gradle.convention import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.plugins.JavaPlatformPlugin import org.sonarqube.gradle.SonarQubePlugin import org.springframework.gradle.maven.SpringMavenPlugin @@ -9,39 +10,7 @@ public class MavenBomPlugin implements Plugin { static String MAVEN_BOM_TASK_NAME = "mavenBom" public void apply(Project project) { - project.configurations { - archives - } + project.plugins.apply(JavaPlatformPlugin) project.plugins.apply(SpringMavenPlugin) - - project.group = project.rootProject.group - project.task(MAVEN_BOM_TASK_NAME, type: MavenBomTask, group: 'Generate', description: 'Configures the pom as a Maven Build of Materials (BOM)') - project.tasks.uploadArchives.dependsOn project.mavenBom - project.tasks.artifactoryPublish.dependsOn project.mavenBom - - project.plugins.withType(SonarQubePlugin) { - project.sonarqube.skipProject = true - } - - project.rootProject.allprojects.each { p -> - p.plugins.withType(SpringMavenPlugin) { - if (!project.name.equals(p.name)) { - project.mavenBom.projects.add(p) - } - } - } - - def deployArtifacts = project.task("deployArtifacts") - deployArtifacts.group = 'Deploy tasks' - deployArtifacts.description = "Deploys the artifacts to either Artifactor or Maven Central" - if(Utils.isRelease(project)) { - deployArtifacts.dependsOn project.tasks.uploadArchives - } else { - deployArtifacts.dependsOn project.tasks.artifactoryPublish - } - - project.artifacts { - archives project.mavenBom.bomFile - } } } diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringPomPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringPomPlugin.groovy deleted file mode 100644 index 955914c54a..0000000000 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringPomPlugin.groovy +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2002-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package io.spring.gradle.convention; - -/** - * @author Rob Winch - */ -public class SpringPomPlugin extends SpringModulePlugin { - -}