Skip to content

Commit 734040a

Browse files
committed
Update Gradle test scripts to avoid warnings with 8.12
Closes gh-43496
1 parent 3117d60 commit 734040a

File tree

34 files changed

+104
-39
lines changed

34 files changed

+104
-39
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-snapshot.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
buildscript {
22
repositories {
3-
maven { url 'https://repo.spring.io/libs-snapshot' }
3+
maven {
4+
url = 'https://repo.spring.io/libs-snapshot'
5+
}
46
}
57

68
dependencies {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
pluginManagement {
22
repositories {
3-
maven { url 'https://repo.spring.io/milestone' }
3+
maven {
4+
url = 'https://repo.spring.io/milestone'
5+
}
46
gradlePluginPortal()
57
}
68
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
pluginManagement {
22
repositories {
3-
maven { url 'https://repo.spring.io/milestone' }
4-
maven { url 'https://repo.spring.io/snapshot' }
3+
maven {
4+
url = 'https://repo.spring.io/milestone'
5+
}
6+
maven {
7+
url = 'https://repo.spring.io/snapshot'
8+
}
59
gradlePluginPortal()
610
}
711
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle.kts

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ apply(plugin = "io.spring.dependency-management")
88
// end::apply[]
99

1010
tasks.register("verify") {
11+
val plugins = project.plugins
1112
doLast {
12-
project.plugins.getPlugin(JavaPlugin::class)
13-
project.plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin::class)
13+
plugins.getPlugin(JavaPlugin::class)
14+
plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin::class)
1415
}
1516
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ dependencyManagement {
2424
}
2525

2626
repositories {
27-
maven { url 'repository' }
27+
maven {
28+
url = 'repository'
29+
}
2830
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ dependencies {
1414
}
1515

1616
repositories {
17-
maven { url 'repository' }
17+
maven {
18+
url = 'repository'
19+
}
1820
}
1921

2022
configurations.all {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ dependencies {
99
}
1010

1111
repositories {
12-
maven { url 'repository' }
12+
maven {
13+
url = 'repository'
14+
}
1315
}
1416

1517
configurations.all {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ ext['slf4j.version'] = '1.7.20'
1919
// end::custom-version[]
2020

2121
repositories {
22-
maven { url 'repository' }
22+
maven {
23+
url = 'repository'
24+
}
2325
}
2426

2527
task slf4jVersion {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ the<DependencyManagementExtension>().apply {
2727
}
2828

2929
tasks.register("slf4jVersion") {
30+
val dependencyManagement = project.the<DependencyManagementExtension>()
3031
doLast {
31-
println(project.the<DependencyManagementExtension>().managedVersions["org.slf4j:slf4j-api"])
32+
println(dependencyManagement.managedVersions["org.slf4j:slf4j-api"])
3233
}
3334
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-milestone.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
buildscript {
22
repositories {
3-
maven { url 'https://repo.spring.io/libs-milestone' }
3+
maven {
4+
url = 'https://repo.spring.io/libs-milestone'
5+
}
46
}
57

68
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-snapshot.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
buildscript {
22
repositories {
3-
maven { url 'https://repo.spring.io/libs-snapshot' }
3+
maven {
4+
url = 'https://repo.spring.io/libs-snapshot'
5+
}
46
}
57

68
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ publishing {
1313
}
1414
repositories {
1515
maven {
16-
url 'https://repo.example.com'
16+
url = 'https://repo.example.com'
1717
}
1818
}
1919
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ task('taskExists') {
1616
}
1717

1818
task('distributionExists') {
19+
def distributions = project.extensions.findByType(DistributionContainer)
1920
doFirst {
20-
boolean found = project.hasProperty('distributions') &&
21-
distributions.findByName(distributionName) != null
21+
boolean found = distributions != null && distributions.findByName(distributionName) != null
2222
println "${distributionName} exists = ${found}"
2323
}
2424
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests.gradle

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ if (project.hasProperty('applyDependencyManagementPlugin')) {
1717
}
1818

1919
repositories {
20-
maven { url 'repository' }
20+
maven {
21+
url = 'repository'
22+
}
2123
}
2224

2325
task doesNotHaveDependencyManagement {
26+
def extensions = project.extensions
2427
doLast {
25-
if (project.extensions.findByName('dependencyManagement') != null) {
28+
if (extensions.findByName('dependencyManagement') != null) {
2629
throw new GradleException('Found dependency management extension')
2730
}
2831
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionPropertyIsSet.gradle

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ dependencyManagement {
1717

1818
repositories {
1919
mavenCentral()
20-
maven { url 'repository' }
20+
maven {
21+
url = 'repository'
22+
}
2123
}
2224

2325
dependencies {
2426
implementation('org.jetbrains.kotlin:kotlin-stdlib-jdk8')
2527
}
2628

2729
task kotlinVersion {
30+
def properties = project.properties
2831
doLast {
29-
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
32+
def kotlinVersion = properties.getOrDefault('kotlin.version', 'none')
3033
println "Kotlin version: ${kotlinVersion}"
3134
}
3235
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-noKotlinVersionPropertyWithoutKotlinPlugin.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ plugins {
33
}
44

55
task kotlinVersion {
6+
def properties = project.properties
67
doLast {
7-
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
8+
def kotlinVersion = properties.getOrDefault('kotlin.version', 'none')
89
println "Kotlin version: ${kotlinVersion}"
910
}
1011
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/OnlyDependencyManagementIntegrationTests.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ plugins {
66
apply plugin: 'io.spring.dependency-management'
77

88
repositories {
9-
maven { url 'repository' }
9+
maven {
10+
url = 'repository'
11+
}
1012
}
1113

1214
dependencyManagement {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootAotPluginIntegrationTests-processTestAotDoesNotHaveDevelopmentOnlyDependenciesOnItsClasspath.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ apply plugin: 'org.springframework.boot.aot'
77

88
repositories {
99
mavenCentral()
10-
maven { url 'repository' }
10+
maven {
11+
url = 'repository'
12+
}
1113
}
1214

1315
configurations.all {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootAotPluginIntegrationTests-processTestAotHasLibraryResourcesOnItsClasspath.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ plugins {
66

77
repositories {
88
mavenCentral()
9-
maven { url 'repository' }
9+
maven {
10+
url = 'repository'
11+
}
1012
}
1113

1214
configurations.all {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootAotPluginIntegrationTests-processTestAotHasTestAndDevelopmentOnlyDependenciesOnItsClasspath.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ apply plugin: 'org.springframework.boot.aot'
77

88
repositories {
99
mavenCentral()
10-
maven { url 'repository' }
10+
maven {
11+
url = 'repository'
12+
}
1113
}
1214

1315
configurations.all {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootAotPluginIntegrationTests-processTestAotHasTransitiveRuntimeDependenciesOnItsClasspath.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ plugins {
66

77
repositories {
88
mavenCentral()
9-
maven { url 'repository' }
9+
maven {
10+
url = 'repository'
11+
}
1012
}
1113

1214
configurations.all {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ bootJar {
2727

2828
repositories {
2929
mavenCentral()
30-
maven { url 'repository' }
30+
maven {
31+
url = 'repository'
32+
}
3133
}
3234

3335
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ plugins {
55

66
repositories {
77
mavenCentral()
8-
maven { url 'repository' }
8+
maven {
9+
url = 'repository'
10+
}
911
}
1012

1113
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ bootJar {
99

1010
repositories {
1111
mavenCentral()
12-
maven { url 'repository' }
12+
maven {
13+
url = 'repository'
14+
}
1315
}
1416

1517
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-layersWithCustomSourceSet.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ bootJar {
1313

1414
repositories {
1515
mavenCentral()
16-
maven { url 'repository' }
16+
maven {
17+
url = 'repository'
18+
}
1719
}
1820

1921
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ bootJar {
4242

4343
repositories {
4444
mavenCentral()
45-
maven { url 'repository' }
45+
maven {
46+
url = 'repository'
47+
}
4648
}
4749

4850
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleImplicitLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ bootJar {
2020

2121
repositories {
2222
mavenCentral()
23-
maven { url 'repository' }
23+
maven {
24+
url = 'repository'
25+
}
2426
}
2527

2628
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-packagedApplicationClasspath.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ task launch(type: JavaExec) {
1010

1111
repositories {
1212
mavenCentral()
13-
maven { url 'repository' }
13+
maven {
14+
url = 'repository'
15+
}
1416
}
1517

1618
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-signed.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ bootJar {
99

1010
repositories {
1111
mavenCentral()
12-
maven { url 'repository' }
12+
maven {
13+
url = 'repository'
14+
}
1315
}
1416

1517
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-customLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ bootWar {
2828

2929
repositories {
3030
mavenCentral()
31-
maven { url 'repository' }
31+
maven {
32+
url = 'repository'
33+
}
3234
}
3335

3436
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-implicitLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ bootWar {
1010

1111
repositories {
1212
mavenCentral()
13-
maven { url 'repository' }
13+
maven {
14+
url = 'repository'
15+
}
1416
}
1517

1618
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-layersWithCustomSourceSet.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ bootWar {
1414

1515
repositories {
1616
mavenCentral()
17-
maven { url 'repository' }
17+
maven {
18+
url = 'repository'
19+
}
1820
}
1921

2022
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-multiModuleCustomLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ bootWar {
4343

4444
repositories {
4545
mavenCentral()
46-
maven { url 'repository' }
46+
maven {
47+
url = 'repository'
48+
}
4749
}
4850

4951
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-multiModuleImplicitLayers.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ bootWar {
2121

2222
repositories {
2323
mavenCentral()
24-
maven { url 'repository' }
24+
maven {
25+
url = 'repository'
26+
}
2527
}
2628

2729
dependencies {

0 commit comments

Comments
 (0)