Raise the minimum supported version of Gradle to 7.4

Closes gh-29674
This commit is contained in:
Andy Wilkinson 2022-02-09 13:52:14 +00:00
parent 819f40f81e
commit 067a8dd3ec
10 changed files with 12 additions and 18 deletions

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -1,7 +1,7 @@
[[build-tool-plugins.gradle]] [[build-tool-plugins.gradle]]
== Spring Boot Gradle Plugin == Spring Boot Gradle Plugin
The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`. The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
It requires Gradle 7.x (7.3 or later). It requires Gradle 7.x (7.4 or later).
See the plugin's documentation to learn more: See the plugin's documentation to learn more:
* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF]) * Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF])

View File

@ -45,7 +45,7 @@ More details on getting started with Spring Boot and Maven can be found in the {
[[getting-started.installing.java.gradle]] [[getting-started.installing.java.gradle]]
==== Gradle Installation ==== Gradle Installation
Spring Boot is compatible with Gradle 7.x (7.3 or later). Spring Boot is compatible with Gradle 7.x (7.4 or later).
If you do not already have Gradle installed, you can follow the instructions at https://gradle.org. If you do not already have Gradle installed, you can follow the instructions at https://gradle.org.
Spring Boot dependencies can be declared by using the `org.springframework.boot` `group`. Spring Boot dependencies can be declared by using the `org.springframework.boot` `group`.

View File

@ -12,7 +12,7 @@ Explicit build support is provided for the following build tools:
| 3.5+ | 3.5+
| Gradle | Gradle
| 7.x (7.3 or later) | 7.x (7.4 or later)
|=== |===

View File

@ -2,6 +2,6 @@
= Introduction = Introduction
The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle]. The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle].
It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`. It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
Spring Boot's Gradle plugin requires Gradle 7.x (7.3 or later) and can be used with Gradle's {gradle-userguide}/configuration_cache.html[configuration cache]. Spring Boot's Gradle plugin requires Gradle 7.x (7.4 or later) and can be used with Gradle's {gradle-userguide}/configuration_cache.html[configuration cache].
In addition to this user guide, {api-documentation}[API documentation] is also available. In addition to this user guide, {api-documentation}[API documentation] is also available.

View File

@ -131,6 +131,7 @@ final class JavaPluginAction implements PluginApplicationAction {
}); });
} }
@SuppressWarnings("deprecation")
private void configureArtifactPublication(TaskProvider<BootJar> bootJar) { private void configureArtifactPublication(TaskProvider<BootJar> bootJar) {
LazyPublishArtifact artifact = new LazyPublishArtifact(bootJar); LazyPublishArtifact artifact = new LazyPublishArtifact(bootJar);
this.singlePublishedArtifact.addCandidate(artifact); this.singlePublishedArtifact.addCandidate(artifact);

View File

@ -106,6 +106,7 @@ class WarPluginAction implements PluginApplicationAction {
.configure((buildImage) -> buildImage.getArchiveFile().set(bootWar.get().getArchiveFile())); .configure((buildImage) -> buildImage.getArchiveFile().set(bootWar.get().getArchiveFile()));
} }
@SuppressWarnings("deprecation")
private void configureArtifactPublication(TaskProvider<BootWar> bootWar) { private void configureArtifactPublication(TaskProvider<BootWar> bootWar) {
LazyPublishArtifact artifact = new LazyPublishArtifact(bootWar); LazyPublishArtifact artifact = new LazyPublishArtifact(bootWar);
this.singlePublishedArtifact.addCandidate(artifact); this.singlePublishedArtifact.addCandidate(artifact);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -66,14 +66,6 @@ public class BuildInfoProperties implements Serializable {
} }
private Provider<String> projectVersion(Project project) { private Provider<String> projectVersion(Project project) {
try {
Provider<String> externalVersionProperty = project.getProviders().gradleProperty("version")
.forUseAtConfigurationTime();
externalVersionProperty.getOrNull();
}
catch (NoSuchMethodError ex) {
// Gradle < 6.5
}
return project.provider(() -> project.getVersion().toString()); return project.provider(() -> project.getVersion().toString());
} }

View File

@ -39,10 +39,10 @@ class SpringBootPluginIntegrationTests {
@DisabledForJreRange(min = JRE.JAVA_14) @DisabledForJreRange(min = JRE.JAVA_14)
@Test @Test
void failFastWithVersionOfGradle6LowerThanRequired() { void failFastWithVersionOfGradle7LowerThanRequired() {
BuildResult result = this.gradleBuild.gradleVersion("6.7.1").buildAndFail(); BuildResult result = this.gradleBuild.gradleVersion("7.3.3").buildAndFail();
assertThat(result.getOutput()).contains( assertThat(result.getOutput())
"Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 6.7.1"); .contains("Spring Boot plugin requires Gradle 7.x (7.4 or later). The current version is Gradle 7.3.3");
} }
@DisabledForJreRange(min = JRE.JAVA_16) @DisabledForJreRange(min = JRE.JAVA_16)