Configure Maven publications with Gradle
Prior to this commit, the build would use a custom task to create a BOM and manually include/exclude/customize dependencies. It would also use the "maven" plugin to customize the POM before publication. This commit now uses a Gradle Java Platform for publishing the Spring Framework BOM. We're also now using the "maven-publish" plugin to prepare and customize publications. This commit also tells the artifactory plugin (which is currently applied only on the CI) not to publish internal modules. See gh-23282
This commit is contained in:
@@ -1,35 +1,23 @@
|
||||
description = "Spring Framework (Bill of Materials)"
|
||||
|
||||
apply plugin: "java"
|
||||
apply plugin: "maven"
|
||||
apply plugin: 'java-platform'
|
||||
apply from: "$rootDir/gradle/publications.gradle"
|
||||
|
||||
configurations.archives.artifacts.clear()
|
||||
artifacts {
|
||||
// work around GRADLE-2406 by attaching text artifact
|
||||
archives(file("spring-framework-bom.txt"))
|
||||
}
|
||||
group = "org.springframework"
|
||||
|
||||
install {
|
||||
repositories.mavenInstaller {
|
||||
pom.whenConfigured {
|
||||
packaging = "pom"
|
||||
withXml {
|
||||
asNode().children().last() + {
|
||||
delegate.dependencyManagement {
|
||||
delegate.dependencies {
|
||||
parent.moduleProjects.sort { "$it.name" }.each { p ->
|
||||
if (p != project) {
|
||||
delegate.dependency {
|
||||
delegate.groupId(p.group)
|
||||
delegate.artifactId(p.name)
|
||||
delegate.version(p.version)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
constraints {
|
||||
parent.moduleProjects.sort { "$it.name" }.each {
|
||||
api it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
springFramework(MavenPublication) {
|
||||
artifactId = 'spring-framework-bom'
|
||||
from components.javaPlatform
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
This meta-project is used to generate a bill-of-materials POM that contains the other
|
||||
projects in a dependencyManagement section.
|
||||
|
||||
<https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/overview.html#overview-getting-started>
|
||||
Reference in New Issue
Block a user