mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Use spring.mavenRepositories in buildSrc for all build types
Refine `buildSrc` so that `spring.mavenRepositories()` are considered for all build types (not just milestones and snapshots). We now pass "springFrameworkVersion" to `SpringRepositorySupport.groovy` so that repo.spring.io doesn't get added for OSS builds using release artifacts. Closes gh-46823
This commit is contained in:
@@ -87,8 +87,8 @@ class SpringRepositoriesExtension {
|
||||
addRepositories { }
|
||||
}
|
||||
|
||||
def mavenRepositories(condition) {
|
||||
if (condition) addRepositories { }
|
||||
def mavenRepositoriesFor(version) {
|
||||
addRepositories(version) { }
|
||||
}
|
||||
|
||||
def mavenRepositoriesExcludingBootGroup() {
|
||||
@@ -100,12 +100,16 @@ class SpringRepositoriesExtension {
|
||||
}
|
||||
|
||||
private void addRepositories(action) {
|
||||
addCommercialRepository("release", false, "/spring-enterprise-maven-prod-local", action)
|
||||
if (this.version.contains("-")) {
|
||||
addRepositories(this.version, action)
|
||||
}
|
||||
|
||||
private void addRepositories(version, action) {
|
||||
addCommercialRepositoryIfNecessary("release", false, "/spring-enterprise-maven-prod-local", action)
|
||||
if (version.contains("-")) {
|
||||
addOssRepository("milestone", false, "/milestone", action)
|
||||
}
|
||||
if (this.version.endsWith("-SNAPSHOT")) {
|
||||
addCommercialRepository("snapshot", true, "/spring-enterprise-maven-dev-local", action)
|
||||
if (version.endsWith("-SNAPSHOT")) {
|
||||
addCommercialRepositoryIfNecessary("snapshot", true, "/spring-enterprise-maven-dev-local", action)
|
||||
addOssRepository("snapshot", true, "/snapshot", action)
|
||||
}
|
||||
}
|
||||
@@ -116,7 +120,7 @@ class SpringRepositoriesExtension {
|
||||
addRepository(name, snapshot, url, action)
|
||||
}
|
||||
|
||||
private void addCommercialRepository(id, snapshot, path, action) {
|
||||
private void addCommercialRepositoryIfNecessary(id, snapshot, path, action) {
|
||||
if (!"commercial".equalsIgnoreCase(this.buildType)) return
|
||||
def name = "spring-commercial-" + id
|
||||
def url = fromEnv("COMMERCIAL_%SREPO_URL", id, "https://usw1.packages.broadcom.com" + path)
|
||||
|
||||
@@ -23,6 +23,7 @@ plugins {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
spring.mavenRepositoriesFor("${springFrameworkVersion}")
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
@@ -31,10 +32,6 @@ java {
|
||||
targetCompatibility = 17
|
||||
}
|
||||
|
||||
repositories {
|
||||
spring.mavenRepositories("${springFrameworkVersion}".contains("-"))
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "${checkstyleToolVersion}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user