parent
83342c7aa7
commit
fb670ee654
|
|
@ -24,7 +24,6 @@ Please refer to the plugin's documentation to learn more:
|
|||
== 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 (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])
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ More details on getting started with Spring Boot and Maven can be found in the {
|
|||
[[getting-started-gradle-installation]]
|
||||
==== Gradle Installation
|
||||
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`.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ 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 (6.3 or later).
|
||||
Gradle 5.6 is also supported but this support is deprecated and will be removed in a future release.
|
||||
Gradle's {gradle-userguide}/configuration_cache.html[configuration cache] is supported when using Gradle 6.7 or later.
|
||||
|
||||
In addition to this user guide, {api-documentation}[API documentation] is also available.
|
||||
|
|
|
|||
|
|
@ -95,10 +95,8 @@ public class SpringBootPlugin implements Plugin<Project> {
|
|||
|
||||
private void verifyGradleVersion() {
|
||||
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). "
|
||||
if (currentVersion.compareTo(GradleVersion.version("6.3")) < 0) {
|
||||
throw new GradleException("Spring Boot plugin requires Gradle 6 (6.3 or later). "
|
||||
+ "The current version is " + currentVersion);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.gradle.api.JavaVersion;
|
||||
import org.gradle.util.GradleVersion;
|
||||
import org.junit.jupiter.api.TestTemplate;
|
||||
import org.junit.jupiter.api.extension.Extension;
|
||||
|
|
@ -43,19 +42,8 @@ import org.springframework.util.StringUtils;
|
|||
*/
|
||||
final class GradleCompatibilityExtension implements TestTemplateInvocationContextProvider {
|
||||
|
||||
private static final List<String> GRADLE_VERSIONS;
|
||||
|
||||
static {
|
||||
JavaVersion javaVersion = JavaVersion.current();
|
||||
if (javaVersion.isCompatibleWith(JavaVersion.VERSION_14)
|
||||
|| javaVersion.isCompatibleWith(JavaVersion.VERSION_13)) {
|
||||
GRADLE_VERSIONS = Arrays.asList("6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1", "current", "7.0-milestone-3");
|
||||
}
|
||||
else {
|
||||
GRADLE_VERSIONS = Arrays.asList("5.6.4", "6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1", "current",
|
||||
"7.0-milestone-3");
|
||||
}
|
||||
}
|
||||
private static final List<String> GRADLE_VERSIONS = Arrays.asList("6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1",
|
||||
"current", "7.0-milestone-3");
|
||||
|
||||
@Override
|
||||
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 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.
|
||||
|
|
@ -16,9 +16,6 @@
|
|||
|
||||
package org.springframework.boot.gradle.plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.gradle.testkit.runner.BuildResult;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.DisabledForJreRange;
|
||||
|
|
@ -40,34 +37,12 @@ class SpringBootPluginIntegrationTests {
|
|||
|
||||
final GradleBuild gradleBuild = new GradleBuild();
|
||||
|
||||
@DisabledForJreRange(min = JRE.JAVA_14)
|
||||
@Test
|
||||
void failFastWithVersionOfGradle5LowerThanRequired() {
|
||||
BuildResult result = this.gradleBuild.gradleVersion("5.5.1").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 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 succeedWithVersionOfGradle5HigherThanRequired() {
|
||||
this.gradleBuild.gradleVersion("5.6.1").build();
|
||||
}
|
||||
|
||||
@DisabledForJreRange(min = JRE.JAVA_13)
|
||||
@Test
|
||||
void succeedWithVersionOfGradle5MatchingWhatIsRequired() {
|
||||
this.gradleBuild.gradleVersion("5.6").build();
|
||||
.contains("Spring Boot plugin requires Gradle 6 (6.3 or later). The current version is Gradle 6.2.2");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -75,10 +50,4 @@ class SpringBootPluginIntegrationTests {
|
|||
this.gradleBuild.gradleVersion("6.3").build();
|
||||
}
|
||||
|
||||
private void createMinimalMainSource() throws IOException {
|
||||
File examplePackage = new File(this.gradleBuild.getProjectDir(), "src/main/java/com/example");
|
||||
examplePackage.mkdirs();
|
||||
new File(examplePackage, "Application.java").createNewFile();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue