Raise the minimum supported version of Gradle to 7.3

Closes gh-28100
This commit is contained in:
Andy Wilkinson
2021-09-22 09:17:45 +01:00
parent 4e884b27f8
commit 814c86c5e8
50 changed files with 277 additions and 558 deletions

View File

@@ -2,6 +2,6 @@
= Introduction
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.8, 6.9, or 7.x and can be used with Gradle's {gradle-userguide}/configuration_cache.html[configuration cache].
Spring Boot's Gradle plugin requires Gradle 7.x (7.3 or later) and can be used with Gradle's {gradle-userguide}/configuration_cache.html[configuration cache].
In addition to this user guide, {api-documentation}[API documentation] is also available.

View File

@@ -23,29 +23,6 @@ include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing]
[[publishing-your-application.maven]]
== Publishing with the Maven Plugin
WARNING: Due to its deprecation in Gradle 6, this plugin's support for publishing with Gradle's `maven` plugin is deprecated and will be removed in a future release.
Please use the `maven-publish` plugin instead.
When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created.
By default, the `bootArchives` configuration contains the archive produced by the `bootJar` or `bootWar` task.
The `uploadBootArchives` task can be configured to publish the archive to a Maven repository:
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
include::../gradle/publishing/maven.gradle[tags=upload]
----
[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin
----
include::../gradle/publishing/maven.gradle.kts[tags=upload]
----
[[publishing-your-application.distribution]]
== Distributing with the Application Plugin
When the {application-plugin}[`application` plugin] is applied a distribution named `boot` is created.

View File

@@ -63,11 +63,3 @@ When Gradle's {application-plugin}[`application` plugin] is applied to a project
5. Configures the `bootJar` task to use the `mainClassName` property as a convention for the `Start-Class` entry in its manifest.
6. Configures the `bootWar` task to use the `mainClassName` property as a convention for the `Start-Class` entry in its manifest.
[[reacting-to-other-plugins.maven]]
== Reacting to the Maven plugin
WARNING: Support for reacting to Gradle's `maven` plugin is deprecated and will be removed in a future release.
Please use the `maven-publish` plugin instead.
When Gradle's {maven-plugin}[`maven` plugin] is applied to a project, the Spring Boot plugin will configure the `uploadBootArchives` `Upload` task to ensure that no dependencies are declared in the pom that it generates.

View File

@@ -1,21 +0,0 @@
plugins {
id 'java'
id 'maven'
id 'org.springframework.boot' version '{gradle-project-version}'
}
// tag::upload[]
uploadBootArchives {
repositories {
mavenDeployer {
repository url: 'https://repo.example.com'
}
}
}
// end::upload[]
task deployerRepository {
doLast {
println uploadBootArchives.repositories.mavenDeployer.repository.url
}
}

View File

@@ -1,26 +0,0 @@
plugins {
java
maven
id("org.springframework.boot") version "{gradle-project-version}"
}
// tag::upload[]
tasks.getByName<Upload>("uploadBootArchives") {
repositories.withGroovyBuilder {
"mavenDeployer" {
"repository"("url" to "https://repo.example.com")
}
}
}
// end::upload[]
val url = tasks.getByName<Upload>("uploadBootArchives")
.repositories
.withGroovyBuilder { getProperty("mavenDeployer") }
.withGroovyBuilder { getProperty("repository") }
.withGroovyBuilder { getProperty("url") }
task("deployerRepository") {
doLast {
println(url)
}
}

View File

@@ -5,7 +5,7 @@ plugins {
// tag::main[]
bootRun {
main = 'com.example.ExampleApplication'
mainClass = 'com.example.ExampleApplication'
}
// end::main[]

View File

@@ -7,12 +7,12 @@ plugins {
// tag::main[]
tasks.getByName<BootRun>("bootRun") {
main = "com.example.ExampleApplication"
mainClass.set("com.example.ExampleApplication")
}
// end::main[]
task("configuredMainClass") {
doLast {
println(tasks.getByName<BootRun>("bootRun").main)
println(tasks.getByName<BootRun>("bootRun").mainClass.get())
}
}