Răsfoiți Sursa

Fix MavenBom

Rob Winch 4 ani în urmă
părinte
comite
c72f8dec0c

+ 11 - 2
bom/spring-security-bom.gradle

@@ -1,4 +1,13 @@
-apply plugin: 'io.spring.convention.bom'
+import io.spring.gradle.convention.SpringModulePlugin
 
-sonarqube.skipProject = true
+apply plugin: 'io.spring.convention.bom'
 
+dependencies {
+	constraints {
+		project.allprojects { p ->
+			p.plugins.withType(SpringModulePlugin) {
+				api p
+			}
+		}
+	}
+}

+ 2 - 33
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<Project> {
 	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
-		}
 	}
 }

+ 0 - 24
buildSrc/src/main/groovy/io/spring/gradle/convention/SpringPomPlugin.groovy

@@ -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 {
-
-}