Raise the minimum supported version of Gradle 6 to 6.3

Closes gh-20532
pull/20754/head
Andy Wilkinson 5 years ago
parent ac949d7851
commit 84e16d55ea

@ -160,7 +160,8 @@ Advanced configuration options and examples are available in the {spring-boot-ma
[[build-tool-plugins-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`.
It requires Gradle 6.x (5.6 is also supported but this support is deprecated and will be removed in a future release).
It requires Gradle 6 (6.3 or later).
Gradle 5.6.x is also supported but this support is deprecated and will be removed in a future release.
Please refer to the plugin's documentation to learn more:
* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF])

@ -41,7 +41,7 @@ Explicit build support is provided for the following build tools:
| 3.3+
| Gradle
| 6.x (5.6 is also supported but in a deprecated form)
| 6 (6.3 or later). 5.6.x is also supported but in a deprecated form
|===
@ -195,8 +195,8 @@ In those cases, see <<using-spring-boot.adoc#using-boot-maven-without-a-parent>>
[[getting-started-gradle-installation]]
==== Gradle Installation
Spring Boot is compatible with 6.x.
5.6 is also supported but this support is deprecated and will be removed in a future release.
Spring Boot is compatible with Gradle 6 (6.3 or later).
Gradle 5.6.x is also supported but this support is deprecated and will be removed in a future release.
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`.

@ -41,7 +41,8 @@ Andy Wilkinson, Scott Frederick
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`.
Spring Boot's Gradle plugin requires Gradle 6.x (5.6 is also supported but this support is deprecated and will be removed in a future release).
Spring Boot's Gradle plugin requires Gradle 6 (6.3 or later).
Gradle 5.6 is also supported but this support is deprecated and will be removed in a future release.
In addition to this user guide, {api-documentation}[API documentation] is also available.

@ -86,9 +86,12 @@ public class SpringBootPlugin implements Plugin<Project> {
}
private void verifyGradleVersion() {
if (GradleVersion.current().compareTo(GradleVersion.version("5.6")) < 0) {
throw new GradleException("Spring Boot plugin requires Gradle 5.6 or later. The current version is "
+ GradleVersion.current());
GradleVersion currentVersion = GradleVersion.current();
if (currentVersion.compareTo(GradleVersion.version("5.6")) < 0
|| (currentVersion.getBaseVersion().compareTo(GradleVersion.version("6.0")) >= 0
&& currentVersion.compareTo(GradleVersion.version("6.3")) < 0)) {
throw new GradleException("Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). "
+ "The current version is " + currentVersion);
}
}

@ -43,10 +43,8 @@ class RunningDocumentationTests {
@TestTemplate
@DisabledForJreRange(min = JRE.JAVA_13)
void bootRunMain() throws IOException {
// Testing of convention mappings is flakey between 5.2 and 6.0 inclusive
// https://github.com/gradle/gradle/issues/11323
assertThat(this.gradleBuild.gradleVersion("6.1-rc-2").script("src/docs/gradle/running/boot-run-main")
.build("configuredMainClass").getOutput()).contains("com.example.ExampleApplication");
assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-main").build("configuredMainClass")
.getOutput()).contains("com.example.ExampleApplication");
}
@TestTemplate

@ -42,14 +42,13 @@ public final class GradleCompatibilityExtension implements TestTemplateInvocatio
private static final List<String> GRADLE_VERSIONS;
static {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
JavaVersion javaVersion = JavaVersion.current();
if (javaVersion.isCompatibleWith(JavaVersion.VERSION_14)
|| javaVersion.isCompatibleWith(JavaVersion.VERSION_13)) {
GRADLE_VERSIONS = Arrays.asList("default");
}
else if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
GRADLE_VERSIONS = Arrays.asList("6.0.1", "6.1.1", "6.2.2", "default");
}
else {
GRADLE_VERSIONS = Arrays.asList("5.6.4", "6.0.1", "6.1.1", "6.2.2", "default");
GRADLE_VERSIONS = Arrays.asList("5.6.4", "default");
}
}

@ -42,24 +42,39 @@ class SpringBootPluginIntegrationTests {
@DisabledForJreRange(min = JRE.JAVA_14)
@Test
void failFastWithVersionOfGradleLowerThanRequired() {
void failFastWithVersionOfGradle5LowerThanRequired() {
BuildResult result = this.gradleBuild.gradleVersion("5.5.1").buildAndFail();
assertThat(result.getOutput())
.contains("Spring Boot plugin requires Gradle 5.6 or later. The current version is Gradle 5.5.1");
.contains("Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). "
+ "The current version is Gradle 5.5.1");
}
@DisabledForJreRange(min = JRE.JAVA_14)
@Test
void failFastWithVersionOfGradle6LowerThanRequired() {
BuildResult result = this.gradleBuild.gradleVersion("6.2.2").buildAndFail();
assertThat(result.getOutput())
.contains("Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). "
+ "The current version is Gradle 6.2.2");
}
@DisabledForJreRange(min = JRE.JAVA_13)
@Test
void succeedWithVersionOfGradleHigherThanRequired() {
void succeedWithVersionOfGradle5HigherThanRequired() {
this.gradleBuild.gradleVersion("5.6.1").build();
}
@DisabledForJreRange(min = JRE.JAVA_13)
@Test
void succeedWithVersionOfGradleMatchingWhatIsRequired() {
void succeedWithVersionOfGradle6MatchingWhatIsRequired() {
this.gradleBuild.gradleVersion("5.6").build();
}
@Test
void succeedWithVersionOfGradle6MatchingWithIsRequired() {
this.gradleBuild.gradleVersion("6.3").build();
}
@Test
void unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails() throws IOException {
createMinimalMainSource();

Loading…
Cancel
Save