mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-06-30 00:36:49 +08:00
Raise minimum supported version of Gradle
Closes gh-41180
This commit is contained in:
parent
63c6b1ee72
commit
28a887ad0f
|
@ -102,9 +102,6 @@ class MavenPublishingConventions {
|
||||||
|
|
||||||
private void customizeJavaMavenPublication(MavenPublication publication, Project project) {
|
private void customizeJavaMavenPublication(MavenPublication publication, Project project) {
|
||||||
addMavenOptionalFeature(publication, project);
|
addMavenOptionalFeature(publication, project);
|
||||||
if (publication.getName().equals("pluginMaven")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
publication.versionMapping((strategy) -> strategy.usage(Usage.JAVA_API, (mappingStrategy) -> mappingStrategy
|
publication.versionMapping((strategy) -> strategy.usage(Usage.JAVA_API, (mappingStrategy) -> mappingStrategy
|
||||||
.fromResolutionOf(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)));
|
.fromResolutionOf(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)));
|
||||||
publication.versionMapping(
|
publication.versionMapping(
|
||||||
|
|
|
@ -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]]
|
[[getting-started.installing.java.gradle]]
|
||||||
=== Gradle Installation
|
=== 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.
|
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`.
|
Spring Boot dependencies can be declared by using the `org.springframework.boot` `group`.
|
||||||
|
|
|
@ -13,7 +13,7 @@ Explicit build support is provided for the following build tools:
|
||||||
| 3.6.3 or later
|
| 3.6.3 or later
|
||||||
|
|
||||||
| Gradle
|
| 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)
|
||||||
|===
|
|===
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,23 +6,6 @@ plugins {
|
||||||
|
|
||||||
description = "Spring Boot Buildpack Platform"
|
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 {
|
dependencies {
|
||||||
api("com.fasterxml.jackson.core:jackson-databind")
|
api("com.fasterxml.jackson.core:jackson-databind")
|
||||||
api("com.fasterxml.jackson.module:jackson-module-parameter-names")
|
api("com.fasterxml.jackson.module:jackson-module-parameter-names")
|
||||||
|
|
|
@ -15,53 +15,6 @@ configurations {
|
||||||
// Downgrade SLF4J is required for tests to run in Eclipse
|
// Downgrade SLF4J is required for tests to run in Eclipse
|
||||||
resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36")
|
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 {
|
dependencies {
|
||||||
|
@ -178,18 +131,3 @@ artifacts {
|
||||||
toolchain {
|
toolchain {
|
||||||
maximumCompatibleJavaVersion = JavaLanguageVersion.of(20)
|
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
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].
|
||||||
It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
|
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.
|
In addition to this user guide, xref:api/java/index.html[API documentation] is also available.
|
||||||
|
|
|
@ -35,9 +35,9 @@ public final class GradleVersions {
|
||||||
@SuppressWarnings("UnstableApiUsage")
|
@SuppressWarnings("UnstableApiUsage")
|
||||||
public static List<String> allCompatible() {
|
public static List<String> allCompatible() {
|
||||||
if (isJavaVersion(JavaVersion.VERSION_20)) {
|
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() {
|
public static String minimumCompatible() {
|
||||||
|
|
|
@ -21,17 +21,6 @@ configurations {
|
||||||
extendsFrom dependencyManagement
|
extendsFrom dependencyManagement
|
||||||
transitive = false
|
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 {
|
dependencies {
|
||||||
|
|
|
@ -11,22 +11,6 @@ configurations {
|
||||||
providedRuntime {
|
providedRuntime {
|
||||||
extendsFrom dependencyManagement
|
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) {
|
task syncMavenRepository(type: Sync) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user