Browse Source

Raise minimum supported version of Gradle

Closes gh-41180
pull/41208/head
Andy Wilkinson 2 years ago
parent
commit
28a887ad0f
  1. 3
      buildSrc/src/main/java/org/springframework/boot/build/MavenPublishingConventions.java
  2. 2
      spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/installing.adoc
  3. 2
      spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/system-requirements.adoc
  4. 17
      spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle
  5. 62
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle
  6. 2
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/introduction.adoc
  7. 4
      spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleVersions.java
  8. 11
      spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle
  9. 16
      spring-boot-system-tests/spring-boot-image-tests/build.gradle

3
buildSrc/src/main/java/org/springframework/boot/build/MavenPublishingConventions.java

@ -102,9 +102,6 @@ class MavenPublishingConventions { @@ -102,9 +102,6 @@ class MavenPublishingConventions {
private void customizeJavaMavenPublication(MavenPublication publication, Project project) {
addMavenOptionalFeature(publication, project);
if (publication.getName().equals("pluginMaven")) {
return;
}
publication.versionMapping((strategy) -> strategy.usage(Usage.JAVA_API, (mappingStrategy) -> mappingStrategy
.fromResolutionOf(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)));
publication.versionMapping(

2
spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/installing.adoc

@ -49,7 +49,7 @@ More details on getting started with Spring Boot and Maven can be found in the x @@ -49,7 +49,7 @@ More details on getting started with Spring Boot and Maven can be found in the x
[[getting-started.installing.java.gradle]]
=== Gradle Installation
Spring Boot is compatible with Gradle 7.x (7.5 or later) and 8.x.
Spring Boot is compatible with Gradle 7.x (7.6.4 or later) or 8.x (8.3 or 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`.

2
spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/system-requirements.adoc

@ -13,7 +13,7 @@ Explicit build support is provided for the following build tools: @@ -13,7 +13,7 @@ Explicit build support is provided for the following build tools:
| 3.6.3 or later
| Gradle
| 7.x (7.5 or later) and 8.x
| Gradle 7.x (7.6.4 or later) or 8.x (8.3 or later)
|===

17
spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle

@ -6,23 +6,6 @@ plugins { @@ -6,23 +6,6 @@ plugins {
description = "Spring Boot Buildpack Platform"
configurations.all {
resolutionStrategy {
eachDependency { dependency ->
// Downgrade Jackson as Gradle cannot cope with 2.15.0's multi-version
// jar files with bytecode in META-INF/versions/19
if (dependency.requested.group.startsWith("com.fasterxml.jackson")) {
dependency.useVersion("2.14.2")
}
// Downgrade Spring Framework as Gradle cannot cope with 6.1.0-M1's
// multi-version jar files with bytecode in META-INF/versions/21
if (dependency.requested.group.equals("org.springframework")) {
dependency.useVersion("$springFramework60xVersion")
}
}
}
}
dependencies {
api("com.fasterxml.jackson.core:jackson-databind")
api("com.fasterxml.jackson.module:jackson-module-parameter-names")

62
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle

@ -15,53 +15,6 @@ configurations { @@ -15,53 +15,6 @@ configurations {
// Downgrade SLF4J is required for tests to run in Eclipse
resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36")
}
modernGradleRuntimeClasspath {
extendsFrom runtimeClasspath
canBeConsumed = false
canBeResolved = true
}
modernGradleRuntimeElements {
extendsFrom configurations.implementation, configurations.runtimeOnly
canBeConsumed = true
canBeResolved = false
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category, Category.LIBRARY))
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling, Bundling.EXTERNAL))
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements, LibraryElements.JAR))
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage, Usage.JAVA_RUNTIME))
attribute(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, project.objects.named(GradlePluginApiVersion, "8.7"))
}
outgoing.artifacts.addAll(configurations.runtimeElements.outgoing.artifacts)
}
runtimeElements {
attributes {
attribute(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, project.objects.named(GradlePluginApiVersion, "7.5"))
}
}
all { configuration ->
if (configuration.name == 'modernGradleRuntimeClasspath') {
return
}
resolutionStrategy {
eachDependency { dependency ->
// Downgrade Jackson as Gradle cannot cope with 2.15.0's multi-version
// jar files with bytecode in META-INF/versions/19
if (dependency.requested.group.startsWith("com.fasterxml.jackson")) {
dependency.useVersion("2.14.2")
}
// Downgrade Spring Framework as Gradle cannot cope with 6.1.0-M1's
// multi-version jar files with bytecode in META-INF/versions/21
if (dependency.requested.group.equals("org.springframework")) {
dependency.useVersion("$springFramework60xVersion")
}
}
}
}
}
components.java.addVariantsFromConfiguration(configurations.modernGradleRuntimeElements) {
mapToMavenScope("runtime")
}
dependencies {
@ -178,18 +131,3 @@ artifacts { @@ -178,18 +131,3 @@ artifacts {
toolchain {
maximumCompatibleJavaVersion = JavaLanguageVersion.of(20)
}
publishing {
publications.matching { it.name == 'pluginMaven' }.configureEach {
versionMapping {
allVariants {
fromResolutionOf(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)
}
}
versionMapping {
variant(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, project.objects.named(GradlePluginApiVersion, "8.7")) {
fromResolutionOf("modernGradleRuntimeClasspath")
}
}
}
}

2
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/introduction.adoc

@ -3,6 +3,6 @@ @@ -3,6 +3,6 @@
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 7.x (7.5 or later) or 8.x and can be used with Gradle's {url-gradle-docs}/configuration_cache.html[configuration cache].
Spring Boot's Gradle plugin requires Gradle 7.x (7.6.4 or later) or 8.x (8.3 or later) and can be used with Gradle's {url-gradle-docs}/configuration_cache.html[configuration cache].
In addition to this user guide, xref:api/java/index.html[API documentation] is also available.

4
spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleVersions.java

@ -35,9 +35,9 @@ public final class GradleVersions { @@ -35,9 +35,9 @@ public final class GradleVersions {
@SuppressWarnings("UnstableApiUsage")
public static List<String> allCompatible() {
if (isJavaVersion(JavaVersion.VERSION_20)) {
return Arrays.asList("8.1.1", "8.8");
return Arrays.asList("8.3", "8.8");
}
return Arrays.asList("7.5.1", GradleVersion.current().getVersion(), "8.0.2", "8.8");
return Arrays.asList(GradleVersion.current().getVersion(), "8.3", "8.8");
}
public static String minimumCompatible() {

11
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle

@ -21,17 +21,6 @@ configurations { @@ -21,17 +21,6 @@ configurations {
extendsFrom dependencyManagement
transitive = false
}
all {
resolutionStrategy {
eachDependency { dependency ->
// Downgrade Spring Framework as Gradle cannot cope with 6.1.0-M1's
// multi-version jar files with bytecode in META-INF/versions/21
if (dependency.requested.group.equals("org.springframework")) {
dependency.useVersion("$springFramework60xVersion")
}
}
}
}
}
dependencies {

16
spring-boot-system-tests/spring-boot-image-tests/build.gradle

@ -11,22 +11,6 @@ configurations { @@ -11,22 +11,6 @@ configurations {
providedRuntime {
extendsFrom dependencyManagement
}
all {
resolutionStrategy {
eachDependency { dependency ->
// Downgrade Jackson as Gradle cannot cope with 2.15.0's multi-version
// jar files with bytecode in META-INF/versions/19
if (dependency.requested.group.startsWith("com.fasterxml.jackson")) {
dependency.useVersion("2.14.2")
}
// Downgrade Spring Framework as Gradle cannot cope with 6.1.0-M1's
// multi-version jar files with bytecode in META-INF/versions/21
if (dependency.requested.group.equals("org.springframework")) {
dependency.useVersion("$springFramework60xVersion")
}
}
}
}
}
task syncMavenRepository(type: Sync) {

Loading…
Cancel
Save