Skip to content

Commit 254b8fe

Browse files
committed
Closes gh-37815
1 parent fec9804 commit 254b8fe

File tree

4 files changed

+39
-31
lines changed

4 files changed

+39
-31
lines changed

buildSrc/build.gradle

+27-25
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,53 @@ repositories {
99
gradlePluginPortal()
1010
}
1111

12-
new File(new File("$projectDir").parentFile, "gradle.properties").withInputStream {
12+
sourceCompatibility = 1.8
13+
targetCompatibility = 1.8
14+
15+
def versions = [:]
16+
new File(projectDir.parentFile, "gradle.properties").withInputStream {
1317
def properties = new Properties()
1418
properties.load(it)
15-
ext.set("kotlinVersion", properties["kotlinVersion"])
16-
ext.set("springFrameworkVersion", properties["springFrameworkVersion"])
17-
if (properties["springFrameworkVersion"].contains("-")) {
18-
repositories {
19-
maven { url "https://repo.spring.io/milestone" }
20-
maven { url "https://repo.spring.io/snapshot" }
21-
}
19+
["assertj", "commonsCodec", "hamcrest", "jackson", "junitJupiter",
20+
"kotlin", "maven", "springFramework"].each {
21+
versions[it] = properties[it + "Version"]
22+
}
23+
}
24+
ext.set("versions", versions)
25+
if (versions.springFramework.contains("-")) {
26+
repositories {
27+
maven { url "https://repo.spring.io/milestone" }
28+
maven { url "https://repo.spring.io/snapshot" }
2229
}
2330
}
24-
25-
sourceCompatibility = 1.8
26-
targetCompatibility = 1.8
2731

2832
dependencies {
2933
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
3034

31-
implementation(platform("org.springframework:spring-framework-bom:${springFrameworkVersion}"))
32-
implementation("com.fasterxml.jackson.core:jackson-databind:2.11.4")
35+
implementation(platform("org.springframework:spring-framework-bom:${versions.springFramework}"))
36+
implementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
3337
implementation("com.gradle:gradle-enterprise-gradle-plugin:3.12.1")
3438
implementation("com.tngtech.archunit:archunit:1.0.0")
35-
implementation("de.undercouch.download:de.undercouch.download.gradle.plugin:5.5.0")
36-
implementation("commons-codec:commons-codec:1.13")
39+
implementation("commons-codec:commons-codec:${versions.commonsCodec}")
3740
implementation("io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}")
38-
implementation("org.apache.maven:maven-embedder:3.6.2")
41+
implementation("org.apache.maven:maven-embedder:${versions.maven}")
3942
implementation("org.asciidoctor:asciidoctor-gradle-jvm:3.3.2")
40-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
41-
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:${kotlinVersion}")
43+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}")
44+
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:${versions.kotlin}")
4245
implementation("org.springframework:spring-context")
4346
implementation("org.springframework:spring-core")
4447
implementation("org.springframework:spring-web")
4548

46-
testImplementation("org.apache.logging.log4j:log4j-core:2.17.1")
47-
testImplementation("org.assertj:assertj-core:3.11.1")
48-
testImplementation("org.hamcrest:hamcrest:2.2")
49-
testImplementation("org.junit.jupiter:junit-jupiter:5.6.0")
49+
testImplementation("org.assertj:assertj-core:${versions.assertj}")
50+
testImplementation("org.hamcrest:hamcrest:${versions.hamcrest}")
51+
testImplementation("org.junit.jupiter:junit-jupiter:${versions.junitJupiter}")
5052
testImplementation("org.springframework:spring-test")
5153

5254
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
5355
}
5456

5557
checkstyle {
56-
toolVersion = 8.11
58+
toolVersion = 9.3
5759
}
5860

5961
gradlePlugin {
@@ -63,8 +65,8 @@ gradlePlugin {
6365
implementationClass = "org.springframework.boot.build.processors.AnnotationProcessorPlugin"
6466
}
6567
architecturePlugin {
66-
id = "org.springframework.boot.architecture"
67-
implementationClass = "org.springframework.boot.build.architecture.ArchitecturePlugin"
68+
id = "org.springframework.boot.architecture"
69+
implementationClass = "org.springframework.boot.build.architecture.ArchitecturePlugin"
6870
}
6971
autoConfigurationPlugin {
7072
id = "org.springframework.boot.auto-configuration"

gradle.properties

+6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ org.gradle.caching=true
44
org.gradle.parallel=true
55
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
66

7+
assertjVersion=3.22.0
8+
commonsCodecVersion=1.15
9+
hamcrestVersion=2.2
10+
jacksonVersion=2.13.5
11+
junitJupiterVersion=5.8.2
712
kotlinVersion=1.6.21
13+
mavenVersion=3.9.4
814
springFrameworkVersion=5.3.30
915
tomcatVersion=9.0.80
1016

spring-boot-project/spring-boot-dependencies/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ bom {
120120
]
121121
}
122122
}
123-
library("AssertJ", "3.22.0") {
123+
library("AssertJ", "${assertjVersion}") {
124124
group("org.assertj") {
125125
modules = [
126126
"assertj-core"
@@ -210,7 +210,7 @@ bom {
210210
]
211211
}
212212
}
213-
library("Commons Codec", "1.15") {
213+
library("Commons Codec", "${commonsCodecVersion}") {
214214
group("commons-codec") {
215215
modules = [
216216
"commons-codec"
@@ -443,7 +443,7 @@ bom {
443443
]
444444
}
445445
}
446-
library("Hamcrest", "2.2") {
446+
library("Hamcrest", "${hamcrestVersion}") {
447447
group("org.hamcrest") {
448448
modules = [
449449
"hamcrest",
@@ -599,7 +599,7 @@ bom {
599599
]
600600
}
601601
}
602-
library("Jackson Bom", "2.13.5") {
602+
library("Jackson Bom", "${jacksonVersion}") {
603603
group("com.fasterxml.jackson") {
604604
imports = [
605605
"jackson-bom"
@@ -1085,7 +1085,7 @@ bom {
10851085
]
10861086
}
10871087
}
1088-
library("JUnit Jupiter", "5.8.2") {
1088+
library("JUnit Jupiter", "${junitJupiterVersion}") {
10891089
group("org.junit") {
10901090
imports = [
10911091
"junit-bom"

spring-boot-project/spring-boot-parent/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ bom {
8080
]
8181
}
8282
}
83-
library("Maven", "3.9.4") {
83+
library("Maven", "${mavenVersion}") {
8484
group("org.apache.maven") {
8585
modules = [
8686
"maven-plugin-api",

0 commit comments

Comments
 (0)