Raise the minimum supported version of Gradle to 4.4

Closes gh-14418
pull/14471/head
Andy Wilkinson 6 years ago
parent 576cc79350
commit a2cf2cd87f

@ -168,7 +168,7 @@ Advanced configuration options and examples are available in the
== 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 4.0 or later. Please
management provided by `spring-boot-dependencies`. It requires Gradle 4.4 or later. Please
refer to the plugin's documentation to learn more:
* Reference ({spring-boot-gradle-plugin}/reference/html[HTML] and

@ -50,7 +50,7 @@ Explicit build support is provided for the following build tools:
|3.2+
|Gradle
|4.x
|4.4+
|===
@ -199,8 +199,8 @@ scope.
[[getting-started-gradle-installation]]
==== Gradle Installation
Spring Boot is compatible with Gradle 4. If you do not already have Gradle installed, you
can follow the instructions at https://gradle.org.
Spring Boot is compatible with Gradle 4.4 and later. 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`.
Typically, your project declares dependencies to one or more

@ -1,6 +1,5 @@
#Thu Jul 27 14:32:22 BST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip

@ -37,7 +37,7 @@ Andy Wilkinson
The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle],
allowing 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 4.0 or later.
Gradle plugin requires Gradle 4.4 or later.
In addition to this user guide, {api-documentation}[API documentation] is also available.

@ -84,8 +84,8 @@ public class SpringBootPlugin implements Plugin<Project> {
}
private void verifyGradleVersion() {
if (GradleVersion.current().compareTo(GradleVersion.version("4.0")) < 0) {
throw new GradleException("Spring Boot plugin requires Gradle 4.0 or later."
if (GradleVersion.current().compareTo(GradleVersion.version("4.4")) < 0) {
throw new GradleException("Spring Boot plugin requires Gradle 4.4 or later."
+ " The current version is " + GradleVersion.current());
}
}

@ -53,7 +53,7 @@ import org.springframework.boot.loader.tools.FileUtils;
*/
class BootZipCopyAction implements CopyAction {
private static final long CONSTANT_TIME_FOR_ZIP_ENTRIES = new GregorianCalendar(1980,
static final long CONSTANT_TIME_FOR_ZIP_ENTRIES = new GregorianCalendar(1980,
Calendar.FEBRUARY, 1, 0, 0, 0).getTimeInMillis();
private final File output;

@ -38,8 +38,8 @@ import org.springframework.boot.gradle.testkit.GradleBuild;
*/
public final class GradleCompatibilitySuite extends Suite {
private static final List<String> GRADLE_VERSIONS = Arrays.asList("default", "4.1",
"4.2", "4.3", "4.4.1", "4.5.1", "4.6", "4.7", "4.8.1", "4.9", "4.10");
private static final List<String> GRADLE_VERSIONS = Arrays.asList("default", "4.5.1",
"4.6", "4.7", "4.8.1", "4.9", "4.10");
public GradleCompatibilitySuite(Class<?> clazz) throws InitializationError {
super(clazz, createRunners(clazz));

@ -39,19 +39,19 @@ public class SpringBootPluginIntegrationTests {
@Test
public void failFastWithVersionOfGradleLowerThanRequired() {
BuildResult result = this.gradleBuild.gradleVersion("3.5.1").buildAndFail();
assertThat(result.getOutput()).contains("Spring Boot plugin requires Gradle 4.0"
+ " or later. The current version is Gradle 3.5.1");
BuildResult result = this.gradleBuild.gradleVersion("4.3").buildAndFail();
assertThat(result.getOutput()).contains("Spring Boot plugin requires Gradle 4.4"
+ " or later. The current version is Gradle 4.3");
}
@Test
public void succeedWithVersionOfGradleHigherThanRequired() {
this.gradleBuild.gradleVersion("4.0.1").build();
this.gradleBuild.gradleVersion("4.4.1").build();
}
@Test
public void succeedWithVersionOfGradleMatchingWhatIsRequired() {
this.gradleBuild.gradleVersion("4.0").build();
this.gradleBuild.gradleVersion("4.4").build();
}
@Test

@ -37,7 +37,6 @@ import org.gradle.api.Project;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import org.gradle.api.tasks.bundling.Jar;
import org.gradle.testfixtures.ProjectBuilder;
import org.gradle.util.GUtil;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@ -281,7 +280,7 @@ public abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
assertThat(entry.getTime())
.isEqualTo(GUtil.CONSTANT_TIME_FOR_ZIP_ENTRIES);
.isEqualTo(BootZipCopyAction.CONSTANT_TIME_FOR_ZIP_ENTRIES);
}
}
}

Loading…
Cancel
Save