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 == Spring Boot Gradle Plugin
The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package 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 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: refer to the plugin's documentation to learn more:
* Reference ({spring-boot-gradle-plugin}/reference/html[HTML] and * 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+ |3.2+
|Gradle |Gradle
|4.x |4.4+
|=== |===
@ -199,8 +199,8 @@ scope.
[[getting-started-gradle-installation]] [[getting-started-gradle-installation]]
==== Gradle Installation ==== Gradle Installation
Spring Boot is compatible with Gradle 4. If you do not already have Gradle installed, you Spring Boot is compatible with Gradle 4.4 and later. If you do not already have Gradle
can follow the instructions at https://gradle.org. 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`.
Typically, your project declares dependencies to one or more 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 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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

@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
warn ( ) { warn () {
echo "$*" echo "$*"
} }
die ( ) { die () {
echo echo
echo "$*" echo "$*"
echo echo
@ -155,7 +155,7 @@ if $cygwin ; then
fi fi
# Escape application args # Escape application args
save ( ) { save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }

@ -37,7 +37,7 @@ Andy Wilkinson
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],
allowing you to package executable jar or war archives, run Spring Boot applications, and 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 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. 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() { private void verifyGradleVersion() {
if (GradleVersion.current().compareTo(GradleVersion.version("4.0")) < 0) { if (GradleVersion.current().compareTo(GradleVersion.version("4.4")) < 0) {
throw new GradleException("Spring Boot plugin requires Gradle 4.0 or later." throw new GradleException("Spring Boot plugin requires Gradle 4.4 or later."
+ " The current version is " + GradleVersion.current()); + " The current version is " + GradleVersion.current());
} }
} }

@ -53,7 +53,7 @@ import org.springframework.boot.loader.tools.FileUtils;
*/ */
class BootZipCopyAction implements CopyAction { 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(); Calendar.FEBRUARY, 1, 0, 0, 0).getTimeInMillis();
private final File output; private final File output;

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

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

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

Loading…
Cancel
Save