Merge branch '3.3.x'

Closes gh-43649 in 3.4.x
Closes gh-43651
This commit is contained in:
Andy Wilkinson
2025-01-02 12:22:59 +00:00
54 changed files with 353 additions and 261 deletions

View File

@@ -26,7 +26,7 @@ dependencies {
}
task syncIntegrationTestSources(type: Sync) {
destinationDir file(layout.buildDirectory.dir("it"))
destinationDir = file(layout.buildDirectory.dir("it"))
from file("src/it")
filter(springRepositoryTransformers.ant())
}

View File

@@ -116,8 +116,8 @@ if (BuildProperties.get(project).buildType() == BuildType.OPEN_SOURCE) {
}
def homebrewFormulaArtifact = artifacts.add("archives", file(layout.buildDirectory.file("homebrew/spring-boot.rb"))) {
type "rb"
classifier "homebrew"
type = "rb"
classifier = "homebrew"
builtBy "homebrewFormula"
}

View File

@@ -1,6 +1,8 @@
buildscript {
repositories {
maven { url 'https://repo.spring.io/libs-snapshot' }
maven {
url = 'https://repo.spring.io/libs-snapshot'
}
}
dependencies {

View File

@@ -1,6 +1,8 @@
pluginManagement {
repositories {
maven { url 'https://repo.spring.io/milestone' }
maven {
url = 'https://repo.spring.io/milestone'
}
gradlePluginPortal()
}
}

View File

@@ -1,7 +1,11 @@
pluginManagement {
repositories {
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
maven {
url = 'https://repo.spring.io/milestone'
}
maven {
url = 'https://repo.spring.io/snapshot'
}
gradlePluginPortal()
}
}

View File

@@ -8,8 +8,9 @@ apply(plugin = "io.spring.dependency-management")
// end::apply[]
tasks.register("verify") {
val plugins = project.plugins
doLast {
project.plugins.getPlugin(JavaPlugin::class)
project.plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin::class)
plugins.getPlugin(JavaPlugin::class)
plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin::class)
}
}

View File

@@ -24,5 +24,7 @@ dependencyManagement {
}
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}

View File

@@ -14,7 +14,9 @@ dependencies {
}
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -9,7 +9,9 @@ dependencies {
}
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -19,7 +19,9 @@ ext['slf4j.version'] = '1.7.20'
// end::custom-version[]
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
task slf4jVersion {

View File

@@ -27,7 +27,8 @@ the<DependencyManagementExtension>().apply {
}
tasks.register("slf4jVersion") {
val dependencyManagement = project.the<DependencyManagementExtension>()
doLast {
println(project.the<DependencyManagementExtension>().managedVersions["org.slf4j:slf4j-api"])
println(dependencyManagement.managedVersions["org.slf4j:slf4j-api"])
}
}

View File

@@ -1,6 +1,8 @@
buildscript {
repositories {
maven { url 'https://repo.spring.io/libs-milestone' }
maven {
url = 'https://repo.spring.io/libs-milestone'
}
}
dependencies {

View File

@@ -1,6 +1,8 @@
buildscript {
repositories {
maven { url 'https://repo.spring.io/libs-snapshot' }
maven {
url = 'https://repo.spring.io/libs-snapshot'
}
}
dependencies {

View File

@@ -13,7 +13,7 @@ publishing {
}
repositories {
maven {
url 'https://repo.example.com'
url = 'https://repo.example.com'
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -181,7 +181,7 @@ class BuildInfoTests {
}
private BuildInfo createTask(Project project) {
return project.getTasks().create("testBuildInfo", BuildInfo.class);
return project.getTasks().register("testBuildInfo", BuildInfo.class).get();
}
private Properties buildInfoProperties(BuildInfo task) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -116,7 +116,7 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
projectDir.mkdirs();
this.project = GradleProjectBuilder.builder().withProjectDir(projectDir).build();
this.project.setDescription("Test project for " + this.taskClass.getSimpleName());
this.task = configure(this.project.getTasks().create("testArchive", this.taskClass));
this.task = this.project.getTasks().register("testArchive", this.taskClass, this::configure).get();
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -58,7 +58,7 @@ class BootBuildImageTests {
projectDir.mkdirs();
this.project = GradleProjectBuilder.builder().withProjectDir(projectDir).withName("build-image-test").build();
this.project.setDescription("Test project for BootBuildImage");
this.buildImage = this.project.getTasks().create("buildImage", BootBuildImage.class);
this.buildImage = this.project.getTasks().register("buildImage", BootBuildImage.class).get();
}
@Test

View File

@@ -16,9 +16,9 @@ task('taskExists') {
}
task('distributionExists') {
def distributions = project.extensions.findByType(DistributionContainer)
doFirst {
boolean found = project.hasProperty('distributions') &&
distributions.findByName(distributionName) != null
boolean found = distributions != null && distributions.findByName(distributionName) != null
println "${distributionName} exists = ${found}"
}
}

View File

@@ -17,12 +17,15 @@ if (project.hasProperty('applyDependencyManagementPlugin')) {
}
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
task doesNotHaveDependencyManagement {
def extensions = project.extensions
doLast {
if (project.extensions.findByName('dependencyManagement') != null) {
if (extensions.findByName('dependencyManagement') != null) {
throw new GradleException('Found dependency management extension')
}
}

View File

@@ -17,7 +17,9 @@ dependencyManagement {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {
@@ -25,8 +27,9 @@ dependencies {
}
task kotlinVersion {
def properties = project.properties
doLast {
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
def kotlinVersion = properties.getOrDefault('kotlin.version', 'none')
println "Kotlin version: ${kotlinVersion}"
}
}

View File

@@ -3,8 +3,9 @@ plugins {
}
task kotlinVersion {
def properties = project.properties
doLast {
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
def kotlinVersion = properties.getOrDefault('kotlin.version', 'none')
println "Kotlin version: ${kotlinVersion}"
}
}

View File

@@ -6,7 +6,9 @@ plugins {
apply plugin: 'io.spring.dependency-management'
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencyManagement {

View File

@@ -7,7 +7,9 @@ apply plugin: 'org.springframework.boot.aot'
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -6,7 +6,9 @@ plugins {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -7,7 +7,9 @@ apply plugin: 'org.springframework.boot.aot'
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -6,7 +6,9 @@ plugins {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -27,7 +27,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -5,7 +5,9 @@ plugins {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -9,7 +9,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -13,7 +13,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -42,7 +42,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -20,7 +20,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -10,7 +10,9 @@ task launch(type: JavaExec) {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -9,7 +9,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -28,7 +28,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -10,7 +10,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -14,7 +14,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -43,7 +43,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -21,7 +21,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {