diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index 35cd303513..1b9198a873 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -1,7 +1,7 @@ plugins { id "java-gradle-plugin" id "maven-publish" - id "org.asciidoctor.jvm.convert" + id "org.antora" id "org.springframework.boot.conventions" id "org.springframework.boot.maven-repository" id "org.springframework.boot.optional-dependencies" @@ -10,7 +10,7 @@ plugins { description = "Spring Boot Gradle Plugins" configurations { - documentation + antoraContent "testCompileClasspath" { // Downgrade SLF4J is required for tests to run in Eclipse resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36") @@ -34,8 +34,6 @@ configurations { } dependencies { - asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids") - implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform")) implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")) implementation("io.spring.gradle:dependency-management-plugin") @@ -86,36 +84,8 @@ validatePlugins { enableStricterValidation = true } -task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) { - enforcedPlatform(":spring-boot-project:spring-boot-dependencies") -} - -tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) { - dependsOn dependencyVersions - inputs.dir('src/docs/gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts') - doFirst { - attributes "dependency-management-plugin-version": dependencyVersions.versionConstraints["io.spring.gradle:dependency-management-plugin"] - } -} - tasks.named('test') { - inputs.dir('src/docs/gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts') -} - -asciidoctor { - sources { - include "index.adoc" - } -} - -task asciidoctorPdf(type: org.asciidoctor.gradle.jvm.AsciidoctorTask) { - sources { - include "index.adoc" - } -} - -tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) { - attributes "native-build-tools-version": nativeBuildToolsVersion + inputs.dir('src/docs/antora/modules/gradle-plugin/examples').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts') } javadoc { @@ -133,25 +103,33 @@ javadoc { } } -task zip(type: Zip) { - dependsOn asciidoctor, asciidoctorPdf - duplicatesStrategy "fail" - from(asciidoctorPdf.outputDir) { - into "reference/pdf" - rename "index.pdf", "${project.name}-reference.pdf" - } - from(asciidoctor.outputDir) { - into "reference/htmlsingle" +def antoraGradlePluginLocalAggregateContent = tasks.register("antoraGradlePluginLocalAggregateContent", Zip) { + destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content') + archiveClassifier = "gradle-plugin-local-aggregate-content" + from(tasks.getByName("generateAntoraYml")) { + into "modules" } +} + +def antoraGradlePluginCatalogContent = tasks.register("antoraGradlePluginCatalogContent", Zip) { + destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content') + archiveClassifier = "gradle-plugin-catalog-content" from(javadoc) { - into "api" + into "api/java" } } +tasks.named("generateAntoraPlaybook") { + xrefStubs = ["appendix:.*", "api:.*", "reference:.*"] + alwaysInclude = [name: "gradle-plugin", classifier: "local-aggregate-content"] + dependsOn antoraGradlePluginLocalAggregateContent +} + +tasks.named("antora") { + inputs.files(antoraGradlePluginLocalAggregateContent, antoraGradlePluginCatalogContent) +} + artifacts { - "documentation" zip + antoraContent antoraGradlePluginCatalogContent } -toolchain { - maximumCompatibleJavaVersion = JavaLanguageVersion.of(20) -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/anchor-rewrite.properties b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/anchor-rewrite.properties similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/anchor-rewrite.properties rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/anchor-rewrite.properties diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/antora.yml b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/antora.yml new file mode 100644 index 0000000000..9d5030f08a --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/antora.yml @@ -0,0 +1,8 @@ +name: spring-boot +ext: + zip_contents_collector: + include: + - name: gradle-plugin + classifier: catalog-content + module: gradle-plugin + destination: content-catalog diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/local-nav.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/local-nav.adoc new file mode 100644 index 0000000000..dd5f26ff4f --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/local-nav.adoc @@ -0,0 +1 @@ +include::gradle-plugin:partial$nav-gradle-plugin.adoc[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/aot/apply-native-image-plugin.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/aot/apply-native-image-plugin.gradle new file mode 100644 index 0000000000..5af481d10b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/aot/apply-native-image-plugin.gradle @@ -0,0 +1,5 @@ +plugins { + id 'org.springframework.boot' version '{version-spring-boot}' + id 'org.graalvm.buildtools.native' version '{version-native-build-tools}' + id 'java' +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/aot/apply-native-image-plugin.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/aot/apply-native-image-plugin.gradle.kts new file mode 100644 index 0000000000..6ef5f11b8c --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/aot/apply-native-image-plugin.gradle.kts @@ -0,0 +1,5 @@ +plugins { + id("org.springframework.boot") version "{version-spring-boot}" + id("org.graalvm.buildtools.native") version "{version-native-build-tools}" + java +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-release.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-release.gradle new file mode 100644 index 0000000000..10a15d6340 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-release.gradle @@ -0,0 +1,3 @@ +plugins { + id 'org.springframework.boot' version '{version-spring-boot}' +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-release.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-release.gradle.kts new file mode 100644 index 0000000000..f0f80a6dec --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-release.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.springframework.boot") version "{version-spring-boot}" +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-snapshot.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-snapshot.gradle similarity index 89% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-snapshot.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-snapshot.gradle index 5ffae4676a..345752a502 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-snapshot.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-snapshot.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { - classpath 'org.springframework.boot:spring-boot-gradle-plugin:{gradle-project-version}' + classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}' } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/milestone-settings.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/milestone-settings.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/milestone-settings.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/milestone-settings.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/snapshot-settings.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/snapshot-settings.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/snapshot-settings.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/snapshot-settings.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle index b044017fc6..ea8a658adc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle @@ -1,7 +1,7 @@ // tag::apply[] plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } apply plugin: 'io.spring.dependency-management' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle.kts similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle.kts index 754080730e..199164e4f3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle.kts @@ -1,7 +1,7 @@ // tag::apply[] plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } apply(plugin = "io.spring.dependency-management") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-additional.gradle similarity index 72% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-additional.gradle index 0412ea4ea8..d8b193e0ad 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-additional.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::additional[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-additional.gradle.kts similarity index 73% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-additional.gradle.kts index 2e3a790d1e..460dbd7762 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-additional.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::additional[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle similarity index 58% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle index b8554d1402..36f3bf0a13 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::build-info[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle.kts similarity index 57% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle.kts index 7eb212645a..0c9165fcf6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::build-info[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-custom-values.gradle similarity index 77% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-custom-values.gradle index 961789da4b..49a0f153c3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-custom-values.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::custom-values[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-custom-values.gradle.kts similarity index 77% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-custom-values.gradle.kts index 1c0d3ce98f..5c95f8e2b0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-custom-values.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::custom-values[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-exclude-time.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-exclude-time.gradle similarity index 65% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-exclude-time.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-exclude-time.gradle index 49c17edab7..486c56fc9c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-exclude-time.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-exclude-time.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::exclude-time[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-exclude-time.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-exclude-time.gradle.kts similarity index 65% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-exclude-time.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-exclude-time.gradle.kts index 9043e7b96c..57c4917645 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-exclude-time.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-exclude-time.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::exclude-time[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom-with-plugins.gradle.kts similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom-with-plugins.gradle.kts index 9f22625463..8fe14db43c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom-with-plugins.gradle.kts @@ -3,8 +3,8 @@ import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension // tag::configure-bom[] plugins { java - id("org.springframework.boot") version "{gradle-project-version}" apply false - id("io.spring.dependency-management") version "{dependency-management-plugin-version}" + id("org.springframework.boot") version "{version-spring-boot}" apply false + id("io.spring.dependency-management") version "{version-dependency-management-plugin}" } dependencyManagement { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle index 2c11b81900..0af7952ca5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::configure-bom[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle.kts similarity index 89% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle.kts index 43dd49deed..16f976cd30 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle.kts @@ -2,7 +2,7 @@ import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::configure-bom[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle similarity index 88% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle index 25a265efe1..7e2bbe9d65 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::configure-platform[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle.kts similarity index 88% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle.kts index 30cfc8ab04..5e8f8ea35e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::configure-platform[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version-with-platform.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version-with-platform.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle index d877c3df16..807c564cf2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version-with-platform.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } dependencies { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version-with-platform.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle.kts similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version-with-platform.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle.kts index a0262204e9..116ba1027e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version-with-platform.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version-with-platform.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } dependencies { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle index ab3d25436f..53dd3f53d8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } apply plugin: 'io.spring.dependency-management' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle.kts similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle.kts index a8359facf4..8103eac661 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle.kts @@ -1,7 +1,7 @@ import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension plugins { - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } apply(plugin = "io.spring.dependency-management") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-milestone.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-milestone.gradle similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-milestone.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-milestone.gradle index 7aa042b4c6..cfafad1175 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-milestone.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-milestone.gradle @@ -4,6 +4,6 @@ buildscript { } dependencies { - classpath 'org.springframework.boot:spring-boot-gradle-plugin:{gradle-project-version}' + classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}' } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-release.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-release.gradle new file mode 100644 index 0000000000..93b9e3036d --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-release.gradle @@ -0,0 +1,3 @@ +plugins { + id 'org.springframework.boot' version '{version-spring-boot}' apply false +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-release.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-release.gradle.kts new file mode 100644 index 0000000000..66f15eee2f --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-release.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.springframework.boot") version "{version-spring-boot}" apply false +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-snapshot.gradle similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-snapshot.gradle index 82b97382ce..94b846d23d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-snapshot.gradle @@ -4,6 +4,6 @@ buildscript { } dependencies { - classpath 'org.springframework.boot:spring-boot-gradle-plugin:{gradle-project-version}' + classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}' } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle index 64e49cc307..1efe1a62f1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } apply plugin: 'io.spring.dependency-management' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle.kts similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle.kts index c1392e1cfe..bcdca3fca5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } apply(plugin = "io.spring.dependency-management") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle similarity index 68% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle index 02a24dda67..5c9d59a7fe 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'application' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle.kts similarity index 67% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle.kts index 23a84fbc25..5bfa89ec08 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle.kts @@ -1,7 +1,7 @@ plugins { java application - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle similarity index 91% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle index 875239d07f..34bf4bc0ea 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle.kts similarity index 92% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle.kts index e492703c6f..4b7dac5288 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::caches[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle similarity index 86% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle index cf0edb18f6..9ccbb2b168 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle.kts similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle.kts index 7e195dbd34..7f301c454b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-buildpacks.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-buildpacks.gradle similarity index 83% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-buildpacks.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-buildpacks.gradle index 9d50b545e7..fe40ca14a3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-buildpacks.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-buildpacks.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::buildpacks[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-buildpacks.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-buildpacks.gradle.kts similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-buildpacks.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-buildpacks.gradle.kts index be45f176c9..e3a6631098 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-buildpacks.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-buildpacks.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::buildpacks[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-caches.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle similarity index 88% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-caches.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle index 9ce86470cf..448be195c1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-caches.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-caches.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle.kts similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-caches.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle.kts index e5b1254567..6b7c7e3c01 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-caches.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::caches[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-token.gradle similarity index 85% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-token.gradle index 9f3bf0ed33..7e30529f82 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-token.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-token.gradle.kts similarity index 89% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-token.gradle.kts index 169c98e26b..223855bfc4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-token.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-user.gradle similarity index 91% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-user.gradle index 7222f93801..4c965307af 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-user.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-user.gradle.kts similarity index 93% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-user.gradle.kts index 92f8c51446..4e36e9c5e7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-auth-user.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-colima.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-colima.gradle similarity index 85% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-colima.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-colima.gradle index bf21d5a1de..5ac63833d1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-colima.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-colima.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-colima.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-colima.gradle.kts similarity index 89% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-colima.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-colima.gradle.kts index 2a227248d2..37e44ea9ac 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-colima.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-colima.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-podman.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-podman.gradle similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-podman.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-podman.gradle index c6c129cc9b..6d23f62583 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-podman.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-podman.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-podman.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-podman.gradle.kts similarity index 91% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-podman.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-podman.gradle.kts index b46e24abe4..130c9225ef 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host-podman.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host-podman.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host.gradle similarity index 89% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host.gradle index de196f7d26..2d6b15cb30 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host.gradle.kts similarity index 92% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host.gradle.kts index 804498bcb2..8bad8550fd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-docker-host.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-proxy.gradle similarity index 83% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-proxy.gradle index 8ad32e87a7..250bffe042 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-proxy.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::env[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-proxy.gradle.kts similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-proxy.gradle.kts index 26f62d6b78..8173893b91 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-proxy.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::env[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-runtime.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-runtime.gradle similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-runtime.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-runtime.gradle index b58a1089d9..92e19500f3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-runtime.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-runtime.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-runtime.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-runtime.gradle.kts similarity index 88% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-runtime.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-runtime.gradle.kts index f4ebbe4e2c..1d667db496 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-runtime.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env-runtime.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::env-runtime[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env.gradle similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env.gradle index 4f6f6db2eb..3a77c7aa45 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::env[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env.gradle.kts similarity index 86% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env.gradle.kts index 976f502344..e473242e1f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-env.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::env[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-name.gradle similarity index 79% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-name.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-name.gradle index 7d87b38d0e..24bcdcc19d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-name.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-name.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::image-name[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-name.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-name.gradle.kts similarity index 84% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-name.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-name.gradle.kts index 01f67fe953..2508b40795 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-name.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-name.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::image-name[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-publish.gradle similarity index 86% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-publish.gradle index 40631d0fc0..290b346881 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-publish.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-publish.gradle.kts similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-publish.gradle.kts index bcc856efa2..8c5ac611a1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-publish.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-publish.gradle.kts @@ -3,7 +3,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar-classifiers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-and-jar-classifiers.gradle similarity index 78% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar-classifiers.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-and-jar-classifiers.gradle index 024266d701..e1da8d495f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar-classifiers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-and-jar-classifiers.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::classifiers[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar-classifiers.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-and-jar-classifiers.gradle.kts similarity index 83% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar-classifiers.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-and-jar-classifiers.gradle.kts index f54362da9c..c124c49d4b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar-classifiers.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-and-jar-classifiers.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::classifiers[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-custom-launch-script.gradle similarity index 78% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-custom-launch-script.gradle index da6918c076..8d17c55d26 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-custom-launch-script.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-custom-launch-script.gradle.kts similarity index 82% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-custom-launch-script.gradle.kts index a3e15f1f5e..daeba8a236 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-custom-launch-script.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-include-launch-script.gradle similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-include-launch-script.gradle index c1f3d348a8..f90dfd2e5c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-include-launch-script.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-include-launch-script.gradle.kts similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-include-launch-script.gradle.kts index 7ffdf42e4f..fa10543b37 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-include-launch-script.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-launch-script-properties.gradle similarity index 79% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-launch-script-properties.gradle index 6f1df662be..dc5abae195 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-launch-script-properties.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-launch-script-properties.gradle.kts similarity index 83% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-launch-script-properties.gradle.kts index b3e4206ca9..ec549aebd5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-launch-script-properties.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-custom.gradle similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-custom.gradle index ba0dde4dc0..bfc5b33c6d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-custom.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-custom.gradle.kts similarity index 91% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-custom.gradle.kts index d5d78a4081..af7b0418d8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-custom.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-disabled.gradle similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-disabled.gradle index 3ea9a62772..f2558ec771 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-disabled.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-disabled.gradle.kts similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-disabled.gradle.kts index 65d2c9477b..9c17e6265d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-disabled.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-exclude-tools.gradle similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-exclude-tools.gradle index 7175092af8..1b7aa555df 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-exclude-tools.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-exclude-tools.gradle.kts similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-exclude-tools.gradle.kts index 06c177b530..82260fe6df 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-layered-exclude-tools.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootJar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-main-class.gradle similarity index 67% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-main-class.gradle index 55b9de16f3..e53d376524 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-main-class.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-main-class.gradle.kts similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-main-class.gradle.kts index 48aea9b011..0e9bcedc3b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-main-class.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-manifest-main-class.gradle similarity index 71% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-manifest-main-class.gradle index f384d8e6a6..5da518696a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-manifest-main-class.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-manifest-main-class.gradle.kts similarity index 78% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-manifest-main-class.gradle.kts index a79bc048cb..5b5aea3560 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-manifest-main-class.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-requires-unpack.gradle similarity index 82% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-requires-unpack.gradle index 3274bdb594..c5dabf9615 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-requires-unpack.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-requires-unpack.gradle.kts similarity index 85% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-requires-unpack.gradle.kts index 4f68e068e6..9cac748630 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-jar-requires-unpack.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-include-devtools.gradle similarity index 82% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-include-devtools.gradle index 1f12601ca7..1b70a6df99 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-include-devtools.gradle @@ -1,6 +1,6 @@ plugins { id 'war' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootWar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-include-devtools.gradle.kts similarity index 85% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-include-devtools.gradle.kts index c151efe9e5..6d2dc3aa27 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-include-devtools.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootWar plugins { war - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootWar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-properties-launcher.gradle similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-properties-launcher.gradle index 6a1897ae3d..73e6b0a733 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-properties-launcher.gradle @@ -1,6 +1,6 @@ plugins { id 'war' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } tasks.named("bootWar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-properties-launcher.gradle.kts similarity index 84% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-properties-launcher.gradle.kts index f5284eb8f2..ae5e7fb739 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-war-properties-launcher.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootWar plugins { war - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } tasks.named("bootWar") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/only-boot-jar.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/only-boot-jar.gradle similarity index 72% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/only-boot-jar.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/only-boot-jar.gradle index 748aa957f3..d13d367a18 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/only-boot-jar.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/only-boot-jar.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::disable-jar[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/only-boot-jar.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/only-boot-jar.gradle.kts similarity index 78% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/only-boot-jar.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/only-boot-jar.gradle.kts index c15f189fdc..efac6cda5d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/only-boot-jar.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/only-boot-jar.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::disable-jar[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/spring-boot-dsl-main-class.gradle similarity index 65% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/spring-boot-dsl-main-class.gradle index c84dffd88e..d352f29007 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/spring-boot-dsl-main-class.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/spring-boot-dsl-main-class.gradle.kts similarity index 65% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/spring-boot-dsl-main-class.gradle.kts index 5fadbfe46b..decaa3c070 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/spring-boot-dsl-main-class.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/war-container-dependency.gradle similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/war-container-dependency.gradle index ad0f0b53e0..b89a09c0a3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/war-container-dependency.gradle @@ -1,6 +1,6 @@ plugins { id 'war' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } apply plugin: 'io.spring.dependency-management' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/war-container-dependency.gradle.kts similarity index 80% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/war-container-dependency.gradle.kts index 7ea6688bcb..2463bb9062 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/war-container-dependency.gradle.kts @@ -1,6 +1,6 @@ plugins { war - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } apply(plugin = "io.spring.dependency-management") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle similarity index 85% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle index 418c5f101f..fa4ad521a4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'maven-publish' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::publishing[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle.kts similarity index 87% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle.kts index f11d2344cf..9e8365a2a2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/publishing/maven-publish.gradle.kts @@ -1,7 +1,7 @@ plugins { java `maven-publish` - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::publishing[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/application-plugin-main-class-name.gradle similarity index 69% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/application-plugin-main-class-name.gradle index 1ee1d23aba..43320567a2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/application-plugin-main-class-name.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'application' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/application-plugin-main-class-name.gradle.kts similarity index 67% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/application-plugin-main-class-name.gradle.kts index 23a84fbc25..5bfa89ec08 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/application-plugin-main-class-name.gradle.kts @@ -1,7 +1,7 @@ plugins { java application - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-disable-optimized-launch.gradle similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-disable-optimized-launch.gradle index fc3811dba1..6e42344189 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-disable-optimized-launch.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::launch[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-disable-optimized-launch.gradle.kts similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-disable-optimized-launch.gradle.kts index 2b8af1dbde..19ee654344 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-disable-optimized-launch.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.run.BootRun plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::launch[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-main.gradle similarity index 76% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-main.gradle index 292a536897..a986be93c4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-main.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-main.gradle.kts similarity index 82% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-main.gradle.kts index 14039f002f..7a9eb36dda 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-main.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.run.BootRun plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-source-resources.gradle similarity index 77% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-source-resources.gradle index e09dac63f8..43d773f77c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-source-resources.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::source-resources[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-source-resources.gradle.kts similarity index 82% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-source-resources.gradle.kts index 73a907b4f3..8db0971184 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-source-resources.gradle.kts @@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.run.BootRun plugins { java - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::source-resources[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-system-property.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-system-property.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-system-property.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-system-property.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-system-property.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-system-property.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-system-property.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/boot-run-system-property.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/spring-boot-dsl-main-class-name.gradle similarity index 68% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/spring-boot-dsl-main-class-name.gradle index 6703507d6d..a8ff734d92 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/spring-boot-dsl-main-class-name.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'application' - id 'org.springframework.boot' version '{gradle-project-version}' + id 'org.springframework.boot' version '{version-spring-boot}' } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/spring-boot-dsl-main-class-name.gradle.kts similarity index 67% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/spring-boot-dsl-main-class-name.gradle.kts index af94660284..23f44c99d3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/running/spring-boot-dsl-main-class-name.gradle.kts @@ -1,7 +1,7 @@ plugins { java application - id("org.springframework.boot") version "{gradle-project-version}" + id("org.springframework.boot") version "{version-spring-boot}" } // tag::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/aot.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/aot.adoc similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/aot.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/aot.adoc index e5f108d917..95eac8a0e0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/aot.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/aot.adoc @@ -1,26 +1,42 @@ [[aot]] = Ahead-of-Time Processing + Spring AOT is a process that analyzes your code at build-time in order to generate an optimized version of it. It is most often used to help generate GraalVM native images. The Spring Boot Gradle plugin provides tasks that can be used to perform AOT processing on both application and test code. -The tasks are configured automatically when the {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied: +The tasks are configured automatically when the {url-native-build-tools-docs-gradle-plugin}[GraalVM Native Image plugin] is applied: + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$aot/apply-native-image-plugin.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$aot/apply-native-image-plugin.gradle.kts[] +---- +====== + -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy ---- -include::../gradle/aot/apply-native-image-plugin.gradle[] ---- -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] .Kotlin ---- -include::../gradle/aot/apply-native-image-plugin.gradle.kts[] ---- + [[aot.processing-applications]] == Processing Applications + Based on your `@SpringBootApplication`-annotated main class, the `processAot` task generates a persistent view of the beans that are going to be contributed at runtime in a way that bean instantiation is as straightforward as possible. Additional post-processing of the factory is possible using callbacks. For instance, these are used to generate the necessary reflection configuration that GraalVM needs to initialize the context in a native image. @@ -28,16 +44,18 @@ For instance, these are used to generate the necessary reflection configuration As the `BeanFactory` is fully prepared at build-time, conditions are also evaluated. This has an important difference compared to what a regular Spring Boot application does at runtime. For instance, if you want to opt-in or opt-out for certain features, you need to configure the environment used at build time to do so. -To this end, the `processAot` task is a {gradle-dsl}/org.gradle.api.tasks.JavaExec.html[`JavaExec`] task and can be configured with environment variables, system properties, and arguments as needed. +To this end, the `processAot` task is a {url-gradle-dsl}/org.gradle.api.tasks.JavaExec.html[`JavaExec`] task and can be configured with environment variables, system properties, and arguments as needed. The `nativeCompile` task of the GraalVM Native Image plugin is automatically configured to use the output of the `processAot` task. + [[aot.processing-tests]] == Processing Tests + The AOT engine can be applied to JUnit 5 tests that use Spring's Test Context Framework. Suitable tests are processed by the `processTestAot` task to generate `ApplicationContextInitializer` code. As with application AOT processing, the `BeanFactory` is fully prepared at build-time. As with `processAot`, the `processTestAot` task is `JavaExec` subclass and can be configured as needed to influence this processing. -The `nativeTest` task of the GraalVM Native Image plugin is automatically configured to use the output of the `processAot` and `processTestAot` tasks. \ No newline at end of file +The `nativeTest` task of the GraalVM Native Image plugin is automatically configured to use the output of the `processAot` and `processTestAot` tasks. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/getting-started.adoc new file mode 100644 index 0000000000..bc55314e63 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/getting-started.adoc @@ -0,0 +1,128 @@ +[[getting-started]] += Getting Started + +To get started with the plugin it needs to be applied to your project. + +ifeval::["{artifact-release-type}" == "release"] +The plugin is https://plugins.gradle.org/plugin/org.springframework.boot[published to Gradle's plugin portal] and can be applied using the `plugins` block: + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-release.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-release.gradle.kts[] +---- +====== +endif::[] + +ifeval::["{artifact-release-type}" == "milestone"] +The plugin is published to the Spring milestones repository. +Gradle can be configured to use the milestones repository and the plugin can then be applied using the `plugins` block. +To configure Gradle to use the milestones repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin): + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/milestone-settings.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/milestone-settings.gradle.kts[] +---- +====== + +The plugin can then be applied using the `plugins` block: + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-release.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-release.gradle.kts[] +---- +====== +endif::[] + +ifeval::["{artifact-release-type}" == "snapshot"] +The plugin is published to the Spring snapshots repository. +Gradle can be configured to use the snapshots repository and the plugin can then be applied using the `plugins` block. +To configure Gradle to use the snapshots repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin): + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/snapshot-settings.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/snapshot-settings.gradle.kts[] +---- +====== + +The plugin can then be applied using the `plugins` block: + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-release.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-release.gradle.kts[] +---- +====== +endif::[] + +Applied in isolation the plugin makes few changes to a project. +Instead, the plugin detects when certain other plugins are applied and reacts accordingly. +For example, when the `java` plugin is applied a task for building an executable jar is automatically configured. +A typical Spring Boot project will apply the {url-gradle-docs-groovy-plugin}[`groovy`], {url-gradle-docs-java-plugin}[`java`], or {url-kotlin-docs-kotlin-plugin}[`org.jetbrains.kotlin.jvm`] plugin as a minimum and also use the {url-dependency-management-plugin-site}[`io.spring.dependency-management`] plugin or Gradle's native bom support for dependency management. +For example: + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/typical-plugins.gradle[tags=apply] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/typical-plugins.gradle.kts[tags=apply] +---- +====== + +To learn more about how the Spring Boot plugin behaves when other plugins are applied please see the section on xref:reacting.adoc[reacting to other plugins]. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/index.adoc new file mode 100644 index 0000000000..9dc14356b5 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/index.adoc @@ -0,0 +1,8 @@ +[[gradle-plugin]] += Gradle Plugin + +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]. + +In addition to this user guide, xref:api/java/index.html[API documentation] is also available. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/integrating-with-actuator.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/integrating-with-actuator.adoc similarity index 54% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/integrating-with-actuator.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/integrating-with-actuator.adoc index 4232d13f7f..4cf5ea3840 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/integrating-with-actuator.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/integrating-with-actuator.adoc @@ -5,23 +5,28 @@ [[integrating-with-actuator.build-info]] == Generating Build Information + Spring Boot Actuator's `info` endpoint automatically publishes information about your build in the presence of a `META-INF/build-info.properties` file. -A {build-info-javadoc}[`BuildInfo`] task is provided to generate this file. +A {apiref-gradle-plugin-boot-build-info}[`BuildInfo`] task is provided to generate this file. The easiest way to use the task is through the plugin's DSL: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-basic.gradle[tags=build-info] +include::example$integrating-with-actuator/build-info-basic.gradle[tags=build-info] ---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$integrating-with-actuator/build-info-basic.gradle.kts[tags=build-info] +---- +====== -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/integrating-with-actuator/build-info-basic.gradle.kts[tags=build-info] ----- - -This will configure a {build-info-javadoc}[`BuildInfo`] task named `bootBuildInfo` and, if it exists, make the Java plugin's `classes` task depend upon it. +This will configure a {apiref-gradle-plugin-boot-build-info}[`BuildInfo`] task named `bootBuildInfo` and, if it exists, make the Java plugin's `classes` task depend upon it. The task's destination directory will be `META-INF` in the output directory of the main source set's resources (typically `build/resources/main`). By default, the generated build information is derived from the project: @@ -48,33 +53,40 @@ By default, the generated build information is derived from the project: The properties can be customized using the DSL: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-custom-values.gradle[tags=custom-values] +include::example$integrating-with-actuator/build-info-custom-values.gradle[tags=custom-values] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-custom-values.gradle.kts[tags=custom-values] +include::example$integrating-with-actuator/build-info-custom-values.gradle.kts[tags=custom-values] ---- +====== To exclude any of the default properties from the generated build information, add its name to the excludes. For example, the `time` property can be excluded as follows: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-exclude-time.gradle[tags=exclude-time] +include::example$integrating-with-actuator/build-info-exclude-time.gradle[tags=exclude-time] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-exclude-time.gradle.kts[tags=exclude-time] +include::example$integrating-with-actuator/build-info-exclude-time.gradle.kts[tags=exclude-time] ---- - +====== The default value for `build.time` is the instant at which the project is being built. A side-effect of this is that the task will never be up-to-date. @@ -84,16 +96,20 @@ If you value build performance or repeatability more highly than the accuracy of Additional properties can also be added to the build information: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-additional.gradle[tags=additional] +include::example$integrating-with-actuator/build-info-additional.gradle[tags=additional] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/integrating-with-actuator/build-info-additional.gradle.kts[tags=additional] +include::example$integrating-with-actuator/build-info-additional.gradle.kts[tags=additional] ---- +====== An additional property's value can be computed lazily by using a `Provider`. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/introduction.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/introduction.adoc similarity index 63% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/introduction.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/introduction.adoc index 429cb4966c..5f2c1deddc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/introduction.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/introduction.adoc @@ -1,7 +1,8 @@ [[introduction]] = 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 7.x (7.5 or later) or 8.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.5 or later) or 8.x and can be used with Gradle's {url-gradle-docs}/configuration_cache.html[configuration cache]. -In addition to this user guide, {api-documentation}[API documentation] is also available. +In addition to this user guide, xref:api/java/index.html[API documentation] is also available. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc similarity index 60% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc index 0b6be6238f..d0c9cf033a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc @@ -1,50 +1,61 @@ [[managing-dependencies]] = Managing Dependencies -To manage dependencies in your Spring Boot application, you can either apply the {dependency-management-plugin}[`io.spring.dependency-management`] plugin or use Gradle's native bom support. + +To manage dependencies in your Spring Boot application, you can either apply the {url-dependency-management-plugin-site}[`io.spring.dependency-management`] plugin or use Gradle's native bom support. The primary benefit of the former is that it offers property-based customization of managed versions, while using the latter will likely result in faster builds. [[managing-dependencies.dependency-management-plugin]] == Managing Dependencies with the Dependency Management Plugin -When you apply the {dependency-management-plugin}[`io.spring.dependency-management`] plugin, Spring Boot's plugin will automatically <> from the version of Spring Boot that you are using. + +When you apply the {url-dependency-management-plugin-site}[`io.spring.dependency-management`] plugin, Spring Boot's plugin will automatically xref:reacting.adoc#reacting-to-other-plugins.dependency-management[import the `spring-boot-dependencies` bom] from the version of Spring Boot that you are using. This provides a similar dependency management experience to the one that's enjoyed by Maven users. For example, it allows you to omit version numbers when declaring dependencies that are managed in the bom. To make use of this functionality, declare dependencies in the usual way but omit the version number: -[source,groovy,indent=0,subs="verbatim",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/dependencies.gradle[tags=dependencies] +include::example$managing-dependencies/dependencies.gradle[tags=dependencies] ---- - -[source,kotlin,indent=0,subs="verbatim",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/dependencies.gradle.kts[tags=dependencies] +include::example$managing-dependencies/dependencies.gradle.kts[tags=dependencies] ---- +====== [[managing-dependencies.dependency-management-plugin.customizing]] === Customizing Managed Versions + The `spring-boot-dependencies` bom that is automatically imported when the dependency management plugin is applied uses properties to control the versions of the dependencies that it manages. -Browse the {version-properties-appendix}[`Dependency versions Appendix`] in the Spring Boot reference for a complete list of these properties. +Browse the xref:appendix:dependency-versions/properties.adoc[Dependency Versions Properties] section in the Spring Boot reference for a complete list of these properties. To customize a managed version you set its corresponding property. For example, to customize the version of SLF4J which is controlled by the `slf4j.version` property: -[source,groovy,indent=0,subs="verbatim",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/custom-version.gradle[tags=custom-version] +include::example$managing-dependencies/custom-version.gradle[tags=custom-version] ---- - -[source,kotlin,indent=0,subs="verbatim",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/custom-version.gradle.kts[tags=custom-version] +include::example$managing-dependencies/custom-version.gradle.kts[tags=custom-version] ---- +====== WARNING: Each Spring Boot release is designed and tested against a specific set of third-party dependencies. Overriding versions may cause compatibility issues and should be done with care. @@ -53,47 +64,64 @@ Overriding versions may cause compatibility issues and should be done with care. [[managing-dependencies.dependency-management-plugin.using-in-isolation]] === Using Spring Boot's Dependency Management in Isolation + Spring Boot's dependency management can be used in a project without applying Spring Boot's plugin to that project. The `SpringBootPlugin` class provides a `BOM_COORDINATES` constant that can be used to import the bom without having to know its group ID, artifact ID, or version. First, configure the project to depend on the Spring Boot plugin but do not apply it: ifeval::["{artifact-release-type}" == "release"] -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/depend-on-plugin-release.gradle[] +include::example$managing-dependencies/depend-on-plugin-release.gradle[] ---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[] +---- +====== +endif::[] -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[] ----- -endif::[] ifeval::["{artifact-release-type}" == "milestone"] -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/depend-on-plugin-milestone.gradle[] +include::example$managing-dependencies/depend-on-plugin-milestone.gradle[] ---- -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[] +include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[] ---- +====== endif::[] + ifeval::["{artifact-release-type}" == "snapshot"] -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/depend-on-plugin-snapshot.gradle[] +include::example$managing-dependencies/depend-on-plugin-snapshot.gradle[] ---- -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[] +include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[] ---- +====== endif::[] The Spring Boot plugin's dependency on the dependency management plugin means that you can use the dependency management plugin without having to declare a dependency on it. @@ -101,17 +129,21 @@ This also means that you will automatically use the same version of the dependen Apply the dependency management plugin and then configure it to import Spring Boot's bom: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/configure-bom.gradle[tags=configure-bom] +include::example$managing-dependencies/configure-bom.gradle[tags=configure-bom] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/configure-bom.gradle.kts[tags=configure-bom] +include::example$managing-dependencies/configure-bom.gradle.kts[tags=configure-bom] ---- +====== The Kotlin code above is a bit awkward. That's because we're using the imperative way of applying the dependency management plugin. @@ -121,36 +153,42 @@ A downside of this method is that it forces us to specify the version of the dep [source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts[tags=configure-bom] +include::example$managing-dependencies/configure-bom-with-plugins.gradle.kts[tags=configure-bom] ---- [[managing-dependencies.dependency-management-plugin.learning-more]] === Learning More -To learn more about the capabilities of the dependency management plugin, please refer to its {dependency-management-plugin-documentation}[documentation]. + +To learn more about the capabilities of the dependency management plugin, please refer to its {url-dependency-management-plugin-docs}[documentation]. [[managing-dependencies.gradle-bom-support]] == Managing Dependencies with Gradle's Bom Support + Gradle allows a bom to be used to manage a project's versions by declaring it as a `platform` or `enforcedPlatform` dependency. A `platform` dependency treats the versions in the bom as recommendations and other versions and constraints in the dependency graph may cause a version of a dependency other than that declared in the bom to be used. An `enforcedPlatform` dependency treats the versions in the bom as requirements and they will override any other version found in the dependency graph. The `SpringBootPlugin` class provides a `BOM_COORDINATES` constant that can be used to declare a dependency upon Spring Boot's bom without having to know its group ID, artifact ID, or version, as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/configure-platform.gradle[tags=configure-platform] +include::example$managing-dependencies/configure-platform.gradle[tags=configure-platform] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/configure-platform.gradle.kts[tags=configure-platform] +include::example$managing-dependencies/configure-platform.gradle.kts[tags=configure-platform] ---- +====== A platform or enforced platform will only constrain the versions of the configuration in which it has been declared or that extend from the configuration in which it has been declared. As a result, in may be necessary to declare the same dependency in more than one configuration. @@ -159,22 +197,27 @@ As a result, in may be necessary to declare the same dependency in more than one [[managing-dependencies.gradle-bom-support.customizing]] === Customizing Managed Versions + When using Gradle's bom support, you cannot use the properties from `spring-boot-dependencies` to control the versions of the dependencies that it manages. Instead, you must use one of the mechanisms that Gradle provides. One such mechanism is a resolution strategy. SLF4J's modules are all in the `org.slf4j` group so their version can be controlled by configuring every dependency in that group to use a particular version, as shown in the following example: -[source,groovy,indent=0,subs="verbatim",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/custom-version-with-platform.gradle[tags=custom-version] +include::example$managing-dependencies/custom-version-with-platform.gradle[tags=custom-version] ---- - -[source,kotlin,indent=0,subs="verbatim",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/managing-dependencies/custom-version-with-platform.gradle.kts[tags=custom-version] +include::example$managing-dependencies/custom-version-with-platform.gradle.kts[tags=custom-version] ---- +====== WARNING: Each Spring Boot release is designed and tested against a specific set of third-party dependencies. Overriding versions may cause compatibility issues and should be done with care. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging-oci-image.adoc similarity index 72% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging-oci-image.adoc index 252b495bf7..c4dbbbb7a7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging-oci-image.adoc @@ -1,17 +1,19 @@ [[build-image]] = Packaging OCI Images + The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from a jar or war file using https://buildpacks.io[Cloud Native Buildpacks] (CNB). Images can be built using the `bootBuildImage` task. NOTE: For security reasons, images build and run as non-root users. -See the {buildpacks-reference}/reference/spec/platform-api/#users[CNB specification] for more details. +See the {url-buildpacks-docs}/reference/spec/platform-api/#users[CNB specification] for more details. -The task is automatically created when the `java` or `war` plugin is applied and is an instance of {boot-build-image-javadoc}[`BootBuildImage`]. +The task is automatically created when the `java` or `war` plugin is applied and is an instance of {apiref-gradle-plugin-boot-build-image}[`BootBuildImage`]. [[build-image.docker-daemon]] == Docker Daemon + The `bootBuildImage` task requires access to a Docker daemon. The task will inspect local Docker CLI https://docs.docker.com/engine/reference/commandline/cli/#configuration-files[configuration files] to determine the current https://docs.docker.com/engine/context/working-with-contexts/[context] and use the context connection information to communicate with a Docker daemon. If the current context can not be determined or the context does not have connection information, then the task will use a default local connection. @@ -61,12 +63,13 @@ The following table summarizes the available properties: | When `true`, the value of the `host` property will be provided to the container that is created for the CNB builder (optional) |=== -For more details, see also <>. +For more details, see also xref:packaging-oci-image.adoc#build-image.examples.docker[examples]. [[build-image.docker-registry]] == Docker Registry + If the Docker images specified by the `builder` or `runImage` properties are stored in a private Docker image registry that requires authentication, the authentication credentials can be provided using `docker.builderRegistry` properties. If the generated Docker image is to be published to a Docker image registry, the authentication credentials can be provided using `docker.publishRegistry` properties. @@ -95,14 +98,15 @@ The following table summarizes the available properties for `docker.builderRegis | Identity token for the Docker image registry user. Required for token authentication. |=== -For more details, see also <>. +For more details, see also xref:packaging-oci-image.adoc#build-image.examples.docker[examples]. [[build-image.customization]] == Image Customizations -The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image. -The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image. + +The plugin invokes a {url-buildpacks-docs}/concepts/components/builder/[builder] to orchestrate the generation of an image. +The builder includes multiple {url-buildpacks-docs}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image. By default, the plugin chooses a builder image. The name of the generated image is deduced from project properties. @@ -115,7 +119,7 @@ The following table summarizes the available properties and their default values | `builder` | `--builder` | Name of the Builder image to use. -| `paketobuildpacks/builder-jammy-base:latest` or `paketobuildpacks/builder-jammy-tiny:latest` when {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied. +| `paketobuildpacks/builder-jammy-base:latest` or `paketobuildpacks/builder-jammy-tiny:latest` when {url-native-build-tools-docs-gradle-plugin}[GraalVM Native Image plugin] is applied. | `runImage` | `--runImage` @@ -124,19 +128,19 @@ The following table summarizes the available properties and their default values | `imageName` | `--imageName` -| {spring-boot-api}/buildpack/platform/docker/type/ImageReference.html#of-java.lang.String-[Image name] for the generated image. +| xref:api:java/org/springframework/boot/buildpack/platform/docker/type/ImageReference.html#of-java.lang.String-[Image name] for the generated image. | `docker.io/library/${project.name}:${project.version}` | `pullPolicy` | `--pullPolicy` -| {spring-boot-api}/buildpack/platform/build/PullPolicy.html[Policy] used to determine when to pull the builder and run images from the registry. +| xref:api:java/org/springframework/boot/buildpack/platform/build/PullPolicy.html[Policy] used to determine when to pull the builder and run images from the registry. Acceptable values are `ALWAYS`, `NEVER`, and `IF_NOT_PRESENT`. | `ALWAYS` | `environment` | | Environment variables that should be passed to the builder. -| Empty or `['BP_NATIVE_IMAGE': 'true']` when {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied. +| Empty or `['BP_NATIVE_IMAGE': 'true']` when {url-native-build-tools-docs-gradle-plugin}[GraalVM Native Image plugin] is applied. | `buildpacks` | @@ -191,7 +195,7 @@ The value supplied will be passed unvalidated to Docker when creating the builde | | A list of one or more additional tags to apply to the generated image. The values provided to the `tags` option should be *full* image references. -See <> for more details. +See xref:packaging-oci-image.adoc#build-image.customization.tags[the tags section] for more details. | | `buildWorkspace` @@ -233,7 +237,7 @@ Application contents will also be in this location in the generated image. NOTE: The plugin detects the target Java compatibility of the project using the JavaPlugin's `targetCompatibility` property. When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version. -You can override this behaviour as shown in the <> examples. +You can override this behaviour as shown in the xref:packaging-oci-image.adoc#build-image.examples.builder-configuration[builder configuration] examples. @@ -262,135 +266,164 @@ Some examples: [[build-image.examples.custom-image-builder]] === Custom Image Builder and Run Image + If you need to customize the builder used to create the image or the run image used to launch the built image, configure the task as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-builder.gradle[tags=builder] +include::example$packaging/boot-build-image-builder.gradle[tags=builder] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-builder.gradle.kts[tags=builder] +include::example$packaging/boot-build-image-builder.gradle.kts[tags=builder] ---- +====== This configuration will use a builder image with the name `mine/java-cnb-builder` and the tag `latest`, and the run image named `mine/java-cnb-run` and the tag `latest`. The builder and run image can be specified on the command line as well, as shown in this example: -[indent=0] +[source,shell] ---- - $ gradle bootBuildImage --builder=mine/java-cnb-builder --runImage=mine/java-cnb-run +$ gradle bootBuildImage --builder=mine/java-cnb-builder --runImage=mine/java-cnb-run ---- [[build-image.examples.builder-configuration]] === Builder Configuration + If the builder exposes configuration options, those can be set using the `environment` property. -The following is an example of {paketo-java-reference}/#configuring-the-jvm-version[configuring the JVM version] used by the Paketo Java buildpacks at build time: +The following is an example of {url-paketo-docs-java-buildpack}/#configuring-the-jvm-version[configuring the JVM version] used by the Paketo Java buildpacks at build time: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-env.gradle[tags=env] +include::example$packaging/boot-build-image-env.gradle[tags=env] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-env.gradle.kts[tags=env] +include::example$packaging/boot-build-image-env.gradle.kts[tags=env] ---- +====== If there is a network proxy between the Docker daemon the builder runs in and network locations that buildpacks download artifacts from, you will need to configure the builder to use the proxy. When using the Paketo builder, this can be accomplished by setting the `HTTPS_PROXY` and/or `HTTP_PROXY` environment variables as show in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-env-proxy.gradle[tags=env] +include::example$packaging/boot-build-image-env-proxy.gradle[tags=env] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-env-proxy.gradle.kts[tags=env] +include::example$packaging/boot-build-image-env-proxy.gradle.kts[tags=env] ---- +====== [[build-image.examples.runtime-jvm-configuration]] === Runtime JVM Configuration -Paketo Java buildpacks {paketo-java-reference}/#runtime-jvm-configuration[configure the JVM runtime environment] by setting the `JAVA_TOOL_OPTIONS` environment variable. + +Paketo Java buildpacks {url-paketo-docs-java-buildpack}/#runtime-jvm-configuration[configure the JVM runtime environment] by setting the `JAVA_TOOL_OPTIONS` environment variable. The buildpack-provided `JAVA_TOOL_OPTIONS` value can be modified to customize JVM runtime behavior when the application image is launched in a container. -Environment variable modifications that should be stored in the image and applied to every deployment can be set as described in the {paketo-reference}/buildpacks/configuration/#environment-variables[Paketo documentation] and shown in the following example: +Environment variable modifications that should be stored in the image and applied to every deployment can be set as described in the {url-paketo-docs}/buildpacks/configuration/#environment-variables[Paketo documentation] and shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-env-runtime.gradle[tags=env-runtime] +include::example$packaging/boot-build-image-env-runtime.gradle[tags=env-runtime] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-env-runtime.gradle.kts[tags=env-runtime] +include::example$packaging/boot-build-image-env-runtime.gradle.kts[tags=env-runtime] ---- +====== [[build-image.examples.custom-image-name]] === Custom Image Name + By default, the image name is inferred from the `name` and the `version` of the project, something like `docker.io/library/${project.name}:${project.version}`. You can take control over the name by setting task properties, as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-name.gradle[tags=image-name] +include::example$packaging/boot-build-image-name.gradle[tags=image-name] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-name.gradle.kts[tags=image-name] +include::example$packaging/boot-build-image-name.gradle.kts[tags=image-name] ---- +====== Note that this configuration does not provide an explicit tag so `latest` is used. It is possible to specify a tag as well, either using `${project.version}`, any property available in the build or a hardcoded version. The image name can be specified on the command line as well, as shown in this example: -[indent=0] +[source,shell] ---- - $ gradle bootBuildImage --imageName=example.com/library/my-app:v1 +$ gradle bootBuildImage --imageName=example.com/library/my-app:v1 ---- [[build-image.examples.buildpacks]] === Buildpacks + By default, the builder will use buildpacks included in the builder image and apply them in a pre-defined order. An alternative set of buildpacks can be provided to apply buildpacks that are not included in the builder, or to change the order of included buildpacks. When one or more buildpacks are provided, only the specified buildpacks will be applied. The following example instructs the builder to use a custom buildpack packaged in a `.tgz` file, followed by a buildpack included in the builder. -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-buildpacks.gradle[tags=buildpacks] +include::example$packaging/boot-build-image-buildpacks.gradle[tags=buildpacks] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-buildpacks.gradle.kts[tags=buildpacks] +include::example$packaging/boot-build-image-buildpacks.gradle.kts[tags=buildpacks] ---- +====== Buildpacks can be specified in any of the forms shown below. @@ -424,6 +457,7 @@ An OCI image containing a https://buildpacks.io/docs/buildpack-author-guide/pack [[build-image.examples.publish]] === Image Publishing + The generated image can be published to a Docker registry by enabling a `publish` option. If the Docker registry requires authentication, the credentials can be configured using `docker.publishRegistry` properties. @@ -432,63 +466,76 @@ If the Docker registry does not require authentication, the `docker.publishRegis NOTE: The registry that the image will be published to is determined by the registry part of the image name (`docker.example.com` in these examples). If `docker.publishRegistry` credentials are configured and include a `url` property, this value is passed to the registry but is not used to determine the publishing registry location. -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-publish.gradle[tags=publish] +include::example$packaging/boot-build-image-publish.gradle[tags=publish] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-publish.gradle.kts[tags=publish] +include::example$packaging/boot-build-image-publish.gradle.kts[tags=publish] ---- +====== The publish option can be specified on the command line as well, as shown in this example: -[indent=0] +[source,shell] ---- - $ gradle bootBuildImage --imageName=docker.example.com/library/my-app:v1 --publishImage +$ gradle bootBuildImage --imageName=docker.example.com/library/my-app:v1 --publishImage ---- [[build-image.examples.caches]] === Builder Cache and Workspace Configuration + The CNB builder caches layers that are used when building and launching an image. By default, these caches are stored as named volumes in the Docker daemon with names that are derived from the full name of the target image. If the image name changes frequently, for example when the project version is used as a tag in the image name, then the caches can be invalidated frequently. The cache volumes can be configured to use alternative names to give more control over cache lifecycle as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-caches.gradle[tags=caches] +include::example$packaging/boot-build-image-caches.gradle[tags=caches] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-caches.gradle.kts[tags=caches] +include::example$packaging/boot-build-image-caches.gradle.kts[tags=caches] ---- +====== Builders and buildpacks need a location to store temporary files during image building. By default, this temporary build workspace is stored in a named volume. The caches and the build workspace can be configured to use bind mounts instead of named volumes, as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-bind-caches.gradle[tags=caches] +include::example$packaging/boot-build-image-bind-caches.gradle[tags=caches] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-bind-caches.gradle.kts[tags=caches] +include::example$packaging/boot-build-image-bind-caches.gradle.kts[tags=caches] ---- +====== @@ -499,43 +546,53 @@ include::../gradle/packaging/boot-build-image-bind-caches.gradle.kts[tags=caches [[build-image.examples.docker.minikube]] ==== Docker Configuration for minikube + The plugin can communicate with the https://minikube.sigs.k8s.io/docs/tasks/docker_daemon/[Docker daemon provided by minikube] instead of the default local connection. On Linux and macOS, environment variables can be set using the command `eval $(minikube docker-env)` after minikube has been started. The plugin can also be configured to use the minikube daemon by providing connection details similar to those shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-host.gradle[tags=docker-host] +include::example$packaging/boot-build-image-docker-host.gradle[tags=docker-host] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-host.gradle.kts[tags=docker-host] +include::example$packaging/boot-build-image-docker-host.gradle.kts[tags=docker-host] ---- +====== [[build-image.examples.docker.podman]] ==== Docker Configuration for podman + The plugin can communicate with a https://podman.io/[podman container engine]. The plugin can be configured to use podman local connection by providing connection details similar to those shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-host-podman.gradle[tags=docker-host] +include::example$packaging/boot-build-image-docker-host-podman.gradle[tags=docker-host] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-host-podman.gradle.kts[tags=docker-host] +include::example$packaging/boot-build-image-docker-host-podman.gradle.kts[tags=docker-host] ---- +====== TIP: With the `podman` CLI installed, the command `podman info --format='{{.Host.RemoteSocket.Path}}'` can be used to get the value for the `docker.host` configuration property shown in this example. @@ -543,51 +600,65 @@ TIP: With the `podman` CLI installed, the command `podman info --format='{{.Host [[build-image.examples.docker.colima]] ==== Docker Configuration for Colima + The plugin can communicate with the Docker daemon provided by https://github.com/abiosoft/colima[Colima]. The `DOCKER_HOST` environment variable can be set by using the command `export DOCKER_HOST=$(docker context inspect colima -f '{{.Endpoints.docker.Host}}').` The plugin can also be configured to use Colima daemon by providing connection details similar to those shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-host-colima.gradle[tags=docker-host] +include::example$packaging/boot-build-image-docker-host-colima.gradle[tags=docker-host] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-host-colima.gradle.kts[tags=docker-host] +include::example$packaging/boot-build-image-docker-host-colima.gradle.kts[tags=docker-host] ---- +====== [[build-image.examples.docker.auth]] ==== Docker Configuration for Authentication + If the builder or run image are stored in a private Docker registry that supports user authentication, authentication details can be provided using `docker.builderRegistry` properties as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-auth-user.gradle[tags=docker-auth-user] +include::example$packaging/boot-build-image-docker-auth-user.gradle[tags=docker-auth-user] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-auth-user.gradle.kts[tags=docker-auth-user] +include::example$packaging/boot-build-image-docker-auth-user.gradle.kts[tags=docker-auth-user] ---- +====== If the builder or run image is stored in a private Docker registry that supports token authentication, the token value can be provided using `docker.builderRegistry` as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-auth-token.gradle[tags=docker-auth-token] +include::example$packaging/boot-build-image-docker-auth-token.gradle[tags=docker-auth-token] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-build-image-docker-auth-token.gradle.kts[tags=docker-auth-token] +include::example$packaging/boot-build-image-docker-auth-token.gradle.kts[tags=docker-auth-token] ---- +====== diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging.adoc similarity index 67% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging.adoc index e8b200f69d..9092c4f7c4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/packaging.adoc @@ -1,41 +1,49 @@ [[packaging-executable]] = Packaging Executable Archives + The plugin can create executable archives (jar files and war files) that contain all of an application's dependencies and can then be run with `java -jar`. [[packaging-executable.jars]] == Packaging Executable Jars + Executable jars can be built using the `bootJar` task. -The task is automatically created when the `java` plugin is applied and is an instance of {boot-jar-javadoc}[`BootJar`]. +The task is automatically created when the `java` plugin is applied and is an instance of xref:api/java/org/springframework/boot/gradle/tasks/bundling/BootJar.html[`BootJar`]. The `assemble` task is automatically configured to depend upon the `bootJar` task so running `assemble` (or `build`) will also run the `bootJar` task. [[packaging-executable.wars]] == Packaging Executable Wars + Executable wars can be built using the `bootWar` task. -The task is automatically created when the `war` plugin is applied and is an instance of {boot-war-javadoc}[`BootWar`]. +The task is automatically created when the `war` plugin is applied and is an instance of {apiref-gradle-plugin-boot-war}[`BootWar`]. The `assemble` task is automatically configured to depend upon the `bootWar` task so running `assemble` (or `build`) will also run the `bootWar` task. [[packaging-executable.wars.deployable]] === Packaging Executable and Deployable Wars + A war file can be packaged such that it can be executed using `java -jar` and deployed to an external container. To do so, the embedded servlet container dependencies should be added to the `providedRuntime` configuration, for example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/war-container-dependency.gradle[tags=dependencies] +include::example$packaging/war-container-dependency.gradle[tags=dependencies] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/war-container-dependency.gradle.kts[tags=dependencies] +include::example$packaging/war-container-dependency.gradle.kts[tags=dependencies] ---- +====== This ensures that they are package in the war file's `WEB-INF/lib-provided` directory from where they will not conflict with the external container's own classes. @@ -45,44 +53,55 @@ NOTE: `providedRuntime` is preferred to Gradle's `compileOnly` configuration as, [[packaging-executable.and-plain-archives]] == Packaging Executable and Plain Archives + By default, when the `bootJar` or `bootWar` tasks are configured, the `jar` or `war` tasks are configured to use `plain` as the convention for their archive classifier. This ensures that `bootJar` and `jar` or `bootWar` and `war` have different output locations, allowing both the executable archive and the plain archive to be built at the same time. If you prefer that the executable archive, rather than the plain archive, uses a classifier, configure the classifiers as shown in the following example for the `jar` and `bootJar` tasks: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-and-jar-classifiers.gradle[tags=classifiers] +include::example$packaging/boot-jar-and-jar-classifiers.gradle[tags=classifiers] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-and-jar-classifiers.gradle.kts[tags=classifiers] +include::example$packaging/boot-jar-and-jar-classifiers.gradle.kts[tags=classifiers] ---- +====== Alternatively, if you prefer that the plain archive isn't built at all, disable its task as shown in the following example for the `jar` task: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/only-boot-jar.gradle[tags=disable-jar] +include::example$packaging/only-boot-jar.gradle[tags=disable-jar] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/only-boot-jar.gradle.kts[tags=disable-jar] +include::example$packaging/only-boot-jar.gradle.kts[tags=disable-jar] ---- +====== WARNING: Do not disable the `jar` task when creating native images. See https://github.com/spring-projects/spring-boot/issues/33238[#33238] for details. + [[packaging-executable.configuring]] == Configuring Executable Archive Packaging -The {boot-jar-javadoc}[`BootJar`] and {boot-war-javadoc}[`BootWar`] tasks are subclasses of Gradle's `Jar` and `War` tasks respectively. + +The xref:api/java/org/springframework/boot/gradle/tasks/bundling/BootJar.html[`BootJar`] and {apiref-gradle-plugin-boot-war}[`BootWar`] tasks are subclasses of Gradle's `Jar` and `War` tasks respectively. As a result, all of the standard configuration options that are available when packaging a jar or war are also available when packaging an executable jar or war. A number of configuration options that are specific to executable jars and wars are also provided. @@ -90,63 +109,80 @@ A number of configuration options that are specific to executable jars and wars [[packaging-executable.configuring.main-class]] === Configuring the Main Class + By default, the executable archive's main class will be configured automatically by looking for a class with a `public static void main(String[])` method in the main source set's output. The main class can also be configured explicitly using the task's `mainClass` property: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-main-class.gradle[tags=main-class] +include::example$packaging/boot-jar-main-class.gradle[tags=main-class] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-main-class.gradle.kts[tags=main-class] +include::example$packaging/boot-jar-main-class.gradle.kts[tags=main-class] ---- +====== Alternatively, the main class name can be configured project-wide using the `mainClass` property of the Spring Boot DSL: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/spring-boot-dsl-main-class.gradle[tags=main-class] +include::example$packaging/spring-boot-dsl-main-class.gradle[tags=main-class] ---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$packaging/spring-boot-dsl-main-class.gradle.kts[tags=main-class] +---- +====== -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/packaging/spring-boot-dsl-main-class.gradle.kts[tags=main-class] ----- +If the {url-gradle-docs-application-plugin}[`application` plugin] has been applied its `mainClass` property must be configured and can be used for the same purpose: -If the {application-plugin}[`application` plugin] has been applied its `mainClass` property must be configured and can be used for the same purpose: - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/application-plugin-main-class.gradle[tags=main-class] +include::example$packaging/application-plugin-main-class.gradle[tags=main-class] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/application-plugin-main-class.gradle.kts[tags=main-class] +include::example$packaging/application-plugin-main-class.gradle.kts[tags=main-class] ---- +====== Lastly, the `Start-Class` attribute can be configured on the task's manifest: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-manifest-main-class.gradle[tags=main-class] +include::example$packaging/boot-jar-manifest-main-class.gradle[tags=main-class] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-manifest-main-class.gradle.kts[tags=main-class] +include::example$packaging/boot-jar-manifest-main-class.gradle.kts[tags=main-class] ---- +====== NOTE: If the main class is written in Kotlin, the name of the generated Java class should be used. By default, this is the name of the Kotlin class with the `Kt` suffix added. @@ -157,43 +193,53 @@ If another name is defined using `@JvmName` then that name should be used. [[packaging-executable.configuring.including-development-only-dependencies]] === Including Development-only Dependencies + By default all dependencies declared in the `developmentOnly` configuration will be excluded from an executable jar or war. If you want to include dependencies declared in the `developmentOnly` configuration in your archive, configure the classpath of its task to include the configuration, as shown in the following example for the `bootWar` task: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-war-include-devtools.gradle[tags=include-devtools] +include::example$packaging/boot-war-include-devtools.gradle[tags=include-devtools] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-war-include-devtools.gradle.kts[tags=include-devtools] +include::example$packaging/boot-war-include-devtools.gradle.kts[tags=include-devtools] ---- +====== [[packaging-executable.configuring.unpacking]] === Configuring Libraries that Require Unpacking + Most libraries can be used directly when nested in an executable archive, however certain libraries can have problems. For example, JRuby includes its own nested jar support which assumes that `jruby-complete.jar` is always directly available on the file system. To deal with any problematic libraries, an executable archive can be configured to unpack specific nested jars to a temporary directory when the executable archive is run. Libraries can be identified as requiring unpacking using Ant-style patterns that match against the absolute path of the source jar file: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-requires-unpack.gradle[tags=requires-unpack] +include::example$packaging/boot-jar-requires-unpack.gradle[tags=requires-unpack] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-requires-unpack.gradle.kts[tags=requires-unpack] +include::example$packaging/boot-jar-requires-unpack.gradle.kts[tags=requires-unpack] ---- +====== For more control a closure can also be used. The closure is passed a `FileTreeElement` and should return a `boolean` indicating whether or not unpacking is required. @@ -202,6 +248,7 @@ The closure is passed a `FileTreeElement` and should return a `boolean` indicati [[packaging-executable.configuring.launch-script]] === Making an Archive Fully Executable + Spring Boot provides support for fully executable archives. An archive is made fully executable by prepending a shell script that knows how to launch the application. On Unix-like platforms, this launch script allows the archive to be run directly like any other executable or to be installed as a service. @@ -212,70 +259,88 @@ It is recommended that you only enable this option if you intend to execute it d To use this feature, the inclusion of the launch script must be enabled: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-include-launch-script.gradle[tags=include-launch-script] +include::example$packaging/boot-jar-include-launch-script.gradle[tags=include-launch-script] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-include-launch-script.gradle.kts[tags=include-launch-script] +include::example$packaging/boot-jar-include-launch-script.gradle.kts[tags=include-launch-script] ---- +====== This will add Spring Boot's default launch script to the archive. The default launch script includes several properties with sensible default values. The values can be customized using the `properties` property: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-launch-script-properties.gradle[tags=launch-script-properties] +include::example$packaging/boot-jar-launch-script-properties.gradle[tags=launch-script-properties] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-launch-script-properties.gradle.kts[tags=launch-script-properties] +include::example$packaging/boot-jar-launch-script-properties.gradle.kts[tags=launch-script-properties] ---- +====== If the default launch script does not meet your needs, the `script` property can be used to provide a custom launch script: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-custom-launch-script.gradle[tags=custom-launch-script] +include::example$packaging/boot-jar-custom-launch-script.gradle[tags=custom-launch-script] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-custom-launch-script.gradle.kts[tags=custom-launch-script] +include::example$packaging/boot-jar-custom-launch-script.gradle.kts[tags=custom-launch-script] ---- +====== [[packaging-executable.configuring.properties-launcher]] === Using the PropertiesLauncher + To use the `PropertiesLauncher` to launch an executable jar or war, configure the task's manifest to set the `Main-Class` attribute: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-war-properties-launcher.gradle[tags=properties-launcher] +include::example$packaging/boot-war-properties-launcher.gradle[tags=properties-launcher] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-war-properties-launcher.gradle.kts[tags=properties-launcher] +include::example$packaging/boot-war-properties-launcher.gradle.kts[tags=properties-launcher] ---- +====== [[packaging-executable.configuring.layered-archives]] === Packaging Layered Jar or War + By default, the `bootJar` task builds an archive that contains the application's classes and dependencies in `BOOT-INF/classes` and `BOOT-INF/lib` respectively. Similarly, `bootWar` builds an archive that contains the application's classes in `WEB-INF/classes` and dependencies in `WEB-INF/lib` and `WEB-INF/lib-provided`. For cases where a docker image needs to be built from the contents of the jar, it's useful to be able to separate these directories further so that they can be written into distinct layers. @@ -295,54 +360,67 @@ Content that is least likely to change should be added first, followed by layers To disable this feature, you can do so in the following manner: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-layered-disabled.gradle[tags=layered] +include::example$packaging/boot-jar-layered-disabled.gradle[tags=layered] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-layered-disabled.gradle.kts[tags=layered] +include::example$packaging/boot-jar-layered-disabled.gradle.kts[tags=layered] ---- +====== When a layered jar or war is created, the `spring-boot-jarmode-layertools` jar will be added as a dependency to your archive. With this jar on the classpath, you can launch your application in a special mode which allows the bootstrap code to run something entirely different from your application, for example, something that extracts the layers. If you wish to exclude this dependency, you can do so in the following manner: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-layered-exclude-tools.gradle[tags=layered] +include::example$packaging/boot-jar-layered-exclude-tools.gradle[tags=layered] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts[tags=layered] +include::example$packaging/boot-jar-layered-exclude-tools.gradle.kts[tags=layered] ---- +====== [[packaging-executable.configuring.layered-archives.configuration]] ==== Custom Layers Configuration + Depending on your application, you may want to tune how layers are created and add new ones. This can be done using configuration that describes how the jar or war can be separated into layers, and the order of those layers. The following example shows how the default ordering described above can be defined explicitly: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-layered-custom.gradle[tags=layered] +include::example$packaging/boot-jar-layered-custom.gradle[tags=layered] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/packaging/boot-jar-layered-custom.gradle.kts[tags=layered] +include::example$packaging/boot-jar-layered-custom.gradle.kts[tags=layered] ---- +====== The `layered` DSL is defined using three parts: diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/publishing.adoc similarity index 69% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/publishing.adoc index 92a14e4b3e..ca428fc012 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/publishing.adoc @@ -5,27 +5,33 @@ [[publishing-your-application.maven-publish]] == Publishing with the Maven-publish Plugin + To publish your Spring Boot jar or war, add it to the publication using the `artifact` method on `MavenPublication`. Pass the task that produces that artifact that you wish to publish to the `artifact` method. For example, to publish the artifact produced by the default `bootJar` task: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/publishing/maven-publish.gradle[tags=publishing] +include::example$publishing/maven-publish.gradle[tags=publishing] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing] +include::example$publishing/maven-publish.gradle.kts[tags=publishing] ---- +====== [[publishing-your-application.distribution]] == Distributing with the Application Plugin -When the {application-plugin}[`application` plugin] is applied a distribution named `boot` is created. + +When the {url-gradle-docs-application-plugin}[`application` plugin] is applied a distribution named `boot` is created. This distribution contains the archive produced by the `bootJar` or `bootWar` task and scripts to launch it on Unix-like platforms and Windows. Zip and tar distributions can be built by the `bootDistZip` and `bootDistTar` tasks respectively. To use the `application` plugin, its `mainClassName` property must be configured with the name of your application's main class. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/reacting.adoc similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/reacting.adoc index 8cec77b489..f283e27cb7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/reacting.adoc @@ -1,5 +1,6 @@ [[reacting-to-other-plugins]] = Reacting to Other Plugins + When another plugin is applied the Spring Boot plugin reacts by making various changes to the project's configuration. This section describes those changes. @@ -7,15 +8,16 @@ This section describes those changes. [[reacting-to-other-plugins.java]] == Reacting to the Java Plugin -When Gradle's {java-plugin}[`java` plugin] is applied to a project, the Spring Boot plugin: -1. Creates a {boot-jar-javadoc}[`BootJar`] task named `bootJar` that will create an executable, uber jar for the project. +When Gradle's {url-gradle-docs-java-plugin}[`java` plugin] is applied to a project, the Spring Boot plugin: + +1. Creates a {apiref-gradle-plugin-boot-jar}[`BootJar`] task named `bootJar` that will create an executable, uber jar for the project. The jar will contain everything on the runtime classpath of the main source set; classes are packaged in `BOOT-INF/classes` and jars are packaged in `BOOT-INF/lib` 2. Configures the `assemble` task to depend on the `bootJar` task. 3. Configures the `jar` task to use `plain` as the convention for its archive classifier. -4. Creates a {boot-build-image-javadoc}[`BootBuildImage`] task named `bootBuildImage` that will create a OCI image using a https://buildpacks.io[buildpack]. -5. Creates a {boot-run-javadoc}[`BootRun`] task named `bootRun` that can be used to run your application using the `main` source set to find its main method and provide its runtime classpath. -6. Creates a {boot-run-javadoc}['BootRun`] task named `bootTestRun` that can be used to run your application using the `test` source set to find its main method and provide its runtime classpath. +4. Creates a {apiref-gradle-plugin-boot-build-image}[`BootBuildImage`] task named `bootBuildImage` that will create a OCI image using a https://buildpacks.io[buildpack]. +5. Creates a {apiref-gradle-plugin-boot-run}[`BootRun`] task named `bootRun` that can be used to run your application using the `main` source set to find its main method and provide its runtime classpath. +6. Creates a {apiref-gradle-plugin-boot-run}['BootRun`] task named `bootTestRun` that can be used to run your application using the `test` source set to find its main method and provide its runtime classpath. 7. Creates a configuration named `bootArchives` that contains the artifact produced by the `bootJar` task. 8. Creates a configuration named `developmentOnly` for dependencies that are only required at development time, such as Spring Boot's Devtools, and should not be packaged in executable jars and wars. 9. Creates a configuration named `testAndDevelopmentOnly` for dependencies that are only required at development time and when writing and running tests and that should not be packaged in executable jars and wars. @@ -27,7 +29,8 @@ When Gradle's {java-plugin}[`java` plugin] is applied to a project, the Spring B [[reacting-to-other-plugins.kotlin]] == Reacting to the Kotlin Plugin -When {kotlin-plugin}[Kotlin's Gradle plugin] is applied to a project, the Spring Boot plugin: + +When {url-kotlin-docs-kotlin-plugin}[Kotlin's Gradle plugin] is applied to a project, the Spring Boot plugin: 1. Aligns the Kotlin version used in Spring Boot's dependency management with the version of the plugin. This is achieved by setting the `kotlin.version` property with a value that matches the version of the Kotlin plugin. @@ -37,9 +40,10 @@ When {kotlin-plugin}[Kotlin's Gradle plugin] is applied to a project, the Spring [[reacting-to-other-plugins.war]] == Reacting to the War Plugin -When Gradle's {war-plugin}[`war` plugin] is applied to a project, the Spring Boot plugin: -1. Creates a {boot-war-javadoc}[`BootWar`] task named `bootWar` that will create an executable, fat war for the project. +When Gradle's {url-gradle-docs-war-plugin}[`war` plugin] is applied to a project, the Spring Boot plugin: + +1. Creates a {apiref-gradle-plugin-boot-war}[`BootWar`] task named `bootWar` that will create an executable, fat war for the project. In addition to the standard packaging, everything in the `providedRuntime` configuration will be packaged in `WEB-INF/lib-provided`. 2. Configures the `assemble` task to depend on the `bootWar` task. 3. Configures the `war` task to use `plain` as the convention for its archive classifier. @@ -49,13 +53,15 @@ When Gradle's {war-plugin}[`war` plugin] is applied to a project, the Spring Boo [[reacting-to-other-plugins.dependency-management]] == Reacting to the Dependency Management Plugin -When the {dependency-management-plugin}[`io.spring.dependency-management` plugin] is applied to a project, the Spring Boot plugin will automatically import the `spring-boot-dependencies` bom. + +When the {url-dependency-management-plugin-site}[`io.spring.dependency-management` plugin] is applied to a project, the Spring Boot plugin will automatically import the `spring-boot-dependencies` bom. [[reacting-to-other-plugins.application]] == Reacting to the Application Plugin -When Gradle's {application-plugin}[`application` plugin] is applied to a project, the Spring Boot plugin: + +When Gradle's {url-gradle-docs-application-plugin}[`application` plugin] is applied to a project, the Spring Boot plugin: 1. Creates a `CreateStartScripts` task named `bootStartScripts` that will create scripts that launch the artifact in the `bootArchives` configuration using `java -jar`. The task is configured to use the `applicationDefaultJvmArgs` property as a convention for its `defaultJvmOpts` property. @@ -69,7 +75,8 @@ When Gradle's {application-plugin}[`application` plugin] is applied to a project [[reacting-to-other-plugins.nbt]] == Reacting to the GraalVM Native Image Plugin -When the {nbt-gradle-plugin}[GraalVM Native Image plugin] is applied to a project, the Spring Boot plugin: + +When the {url-native-build-tools-docs-gradle-plugin}[GraalVM Native Image plugin] is applied to a project, the Spring Boot plugin: . Applies the `org.springframework.boot.aot` plugin that: .. Registers `aot` and `aotTest` source sets. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/running.adoc similarity index 56% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/running.adoc index 1ae0f5feb1..f084e5a1b1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/running.adoc @@ -1,109 +1,132 @@ [[running-your-application]] = Running your Application with Gradle + To run your application without first building an archive use the `bootRun` task: -[source,bash,indent=0,subs="verbatim"] +[source,shell] ---- - $ ./gradlew bootRun +$ ./gradlew bootRun ---- -The `bootRun` task is an instance of {boot-run-javadoc}[`BootRun`] which is a `JavaExec` subclass. -As such, all of the {gradle-dsl}/org.gradle.api.tasks.JavaExec.html[usual configuration options] for executing a Java process in Gradle are available to you. +The `bootRun` task is an instance of xref:api/java/org/springframework/boot/gradle/tasks/run/BootRun.html[`BootRun`] which is a `JavaExec` subclass. +As such, all of the {url-gradle-dsl}/org.gradle.api.tasks.JavaExec.html[usual configuration options] for executing a Java process in Gradle are available to you. The task is automatically configured to use the runtime classpath of the main source set. By default, the main class will be configured automatically by looking for a class with a `public static void main(String[])` method in the main source set's output. The main class can also be configured explicitly using the task's `main` property: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-main.gradle[tags=main] +include::example$running/boot-run-main.gradle[tags=main] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-main.gradle.kts[tags=main] +include::example$running/boot-run-main.gradle.kts[tags=main] ---- +====== Alternatively, the main class name can be configured project-wide using the `mainClass` property of the Spring Boot DSL: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/spring-boot-dsl-main-class-name.gradle[tags=main-class] +include::example$running/spring-boot-dsl-main-class-name.gradle[tags=main-class] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/spring-boot-dsl-main-class-name.gradle.kts[tags=main-class] +include::example$running/spring-boot-dsl-main-class-name.gradle.kts[tags=main-class] ---- +====== By default, `bootRun` will configure the JVM to optimize its launch for faster startup during development. This behavior can be disabled by using the `optimizedLaunch` property, as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-disable-optimized-launch.gradle[tags=launch] +include::example$running/boot-run-disable-optimized-launch.gradle[tags=launch] ---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$running/boot-run-disable-optimized-launch.gradle.kts[tags=launch] +---- +====== -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/running/boot-run-disable-optimized-launch.gradle.kts[tags=launch] ----- +If the {url-gradle-docs-application-plugin}[`application` plugin] has been applied, its `mainClass` property must be configured and can be used for the same purpose: -If the {application-plugin}[`application` plugin] has been applied, its `mainClass` property must be configured and can be used for the same purpose: - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/application-plugin-main-class-name.gradle[tags=main-class] +include::example$running/application-plugin-main-class-name.gradle[tags=main-class] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/application-plugin-main-class-name.gradle.kts[tags=main-class] +include::example$running/application-plugin-main-class-name.gradle.kts[tags=main-class] ---- +====== [[running-your-application.passing-arguments]] == Passing Arguments to your Application + Like all `JavaExec` tasks, arguments can be passed into `bootRun` from the command line using `--args=''` when using Gradle 4.9 or later. For example, to run your application with a profile named `dev` active the following command can be used: -[source,bash,indent=0,subs="verbatim"] +[source,shell] ---- - $ ./gradlew bootRun --args='--spring.profiles.active=dev' +$ ./gradlew bootRun --args='--spring.profiles.active=dev' ---- -See {gradle-api}/org/gradle/api/tasks/JavaExec.html#setArgsString-java.lang.String-[the javadoc for `JavaExec.setArgsString`] for further details. +See {url-gradle-javadoc}/org/gradle/api/tasks/JavaExec.html#setArgsString-java.lang.String-[the javadoc for `JavaExec.setArgsString`] for further details. [[running-your-application.passing-system-properties]] == Passing System properties to your application + Since `bootRun` is a standard `JavaExec` task, system properties can be passed to the application's JVM by specifying them in the build script. -To make that value of a system property to be configurable set its value using a {gradle-dsl}/org.gradle.api.Project.html#N14FE1[project property]. +To make that value of a system property to be configurable set its value using a {url-gradle-dsl}/org.gradle.api.Project.html#N14FE1[project property]. To allow a project property to be optional, reference it using `findProperty`. Doing so also allows a default value to be provided using the `?:` Elvis operator, as shown in the following example: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-system-property.gradle[tags=system-property] +include::example$running/boot-run-system-property.gradle[tags=system-property] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-system-property.gradle.kts[tags=system-property] +include::example$running/boot-run-system-property.gradle.kts[tags=system-property] ---- +====== The preceding example sets that `com.example.property` system property to the value of the `example` project property. If the `example` project property has not been set, the value of the system property will be `default`. @@ -122,23 +145,28 @@ The preceding example sets the value of the `example` project property to `custo [[running-your-application.reloading-resources]] == Reloading Resources + If devtools has been added to your project it will automatically monitor your application's classpath for changes. Note that modified files need to be recompiled for the classpath to update in order to trigger reloading with devtools. -For more details on using devtools, refer to {spring-boot-reference}#using.devtools.restart[this section of the reference documentation]. +For more details on using devtools, refer to xref:reference:using/devtools.adoc#using.devtools.restart[this section of the reference documentation]. Alternatively, you can configure `bootRun` such that your application's static resources are loaded from their source location: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-source-resources.gradle[tags=source-resources] +include::example$running/boot-run-source-resources.gradle[tags=source-resources] ---- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] ---- -include::../gradle/running/boot-run-source-resources.gradle.kts[tags=source-resources] +include::example$running/boot-run-source-resources.gradle.kts[tags=source-resources] ---- +====== This makes them reloadable in the live application which can be helpful at development time. @@ -146,6 +174,7 @@ This makes them reloadable in the live application which can be helpful at devel [[running-your-application.using-a-test-main-class]] == Using a Test Main Class + In addition to `bootRun` a `bootTestRun` task is also registered. Like `bootRun`, `bootTestRun` is an instance of `BootRun` but it's configured to use a main class found in the output of the test source set rather than the main source set. It also uses the test source set's runtime classpath rather than the main source set's runtime classpath. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/partials/nav-gradle-plugin.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/partials/nav-gradle-plugin.adoc new file mode 100644 index 0000000000..741a8f7a05 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/partials/nav-gradle-plugin.adoc @@ -0,0 +1,10 @@ +* xref:gradle-plugin:index.adoc[] +** xref:gradle-plugin:getting-started.adoc[] +** xref:gradle-plugin:managing-dependencies.adoc[] +** xref:gradle-plugin:packaging.adoc[] +** xref:gradle-plugin:packaging-oci-image.adoc[] +** xref:gradle-plugin:publishing.adoc[] +** xref:gradle-plugin:running.adoc[] +** xref:gradle-plugin:aot.adoc[] +** xref:gradle-plugin:integrating-with-actuator.adoc[] +** xref:gradle-plugin:reacting.adoc[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc deleted file mode 100644 index 5828e3b8d9..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc +++ /dev/null @@ -1,100 +0,0 @@ -[[getting-started]] -= Getting Started -To get started with the plugin it needs to be applied to your project. - -ifeval::["{artifact-release-type}" == "release"] -The plugin is https://plugins.gradle.org/plugin/org.springframework.boot[published to Gradle's plugin portal] and can be applied using the `plugins` block: -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy ----- -include::../gradle/getting-started/apply-plugin-release.gradle[] ----- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/getting-started/apply-plugin-release.gradle.kts[] ----- -endif::[] -ifeval::["{artifact-release-type}" == "milestone"] -The plugin is published to the Spring milestones repository. -Gradle can be configured to use the milestones repository and the plugin can then be applied using the `plugins` block. -To configure Gradle to use the milestones repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin): - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy ----- -include::../gradle/getting-started/milestone-settings.gradle[] ----- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/getting-started/milestone-settings.gradle.kts[] ----- - -The plugin can then be applied using the `plugins` block: - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy ----- -include::../gradle/getting-started/apply-plugin-release.gradle[] ----- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/getting-started/apply-plugin-release.gradle.kts[] ----- -endif::[] -ifeval::["{artifact-release-type}" == "snapshot"] -The plugin is published to the Spring snapshots repository. -Gradle can be configured to use the snapshots repository and the plugin can then be applied using the `plugins` block. -To configure Gradle to use the snapshots repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin): - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy ----- -include::../gradle/getting-started/snapshot-settings.gradle[] ----- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/getting-started/snapshot-settings.gradle.kts[] ----- - -The plugin can then be applied using the `plugins` block: - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy ----- -include::../gradle/getting-started/apply-plugin-release.gradle[] ----- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/getting-started/apply-plugin-release.gradle.kts[] ----- -endif::[] - -Applied in isolation the plugin makes few changes to a project. -Instead, the plugin detects when certain other plugins are applied and reacts accordingly. -For example, when the `java` plugin is applied a task for building an executable jar is automatically configured. -A typical Spring Boot project will apply the {groovy-plugin}[`groovy`], {java-plugin}[`java`], or {kotlin-plugin}[`org.jetbrains.kotlin.jvm`] plugin as a minimum and also use the {dependency-management-plugin}[`io.spring.dependency-management`] plugin or Gradle's native bom support for dependency management. -For example: - -[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] -.Groovy ----- -include::../gradle/getting-started/typical-plugins.gradle[tags=apply] ----- - -[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"] -.Kotlin ----- -include::../gradle/getting-started/typical-plugins.gradle.kts[tags=apply] ----- - -To learn more about how the Spring Boot plugin behaves when other plugins are applied please see the section on <>. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc deleted file mode 100644 index 3b6f8ae1fd..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc +++ /dev/null @@ -1,64 +0,0 @@ -[[spring-boot-gradle-plugin-documentation]] -= Spring Boot Gradle Plugin Reference Guide -Andy Wilkinson; Scott Frederick; Moritz Halbritter -v{gradle-project-version} -:!version-label: -:doctype: book -:toc: left -:toclevels: 4 -:numbered: -:sectanchors: -:icons: font -:hide-uri-scheme: -:docinfo: shared,private -:attribute-missing: warn -:dependency-management-plugin: https://github.com/spring-gradle-plugins/dependency-management-plugin -:dependency-management-plugin-documentation: https://docs.spring.io/dependency-management-plugin/docs/current/reference/html/ -:gradle-userguide: https://docs.gradle.org/current/userguide -:gradle-dsl: https://docs.gradle.org/current/dsl -:gradle-api: https://docs.gradle.org/current/javadoc -:application-plugin: {gradle-userguide}/application_plugin.html -:groovy-plugin: {gradle-userguide}/groovy_plugin.html -:java-plugin: {gradle-userguide}/java_plugin.html -:war-plugin: {gradle-userguide}/war_plugin.html -:maven-plugin: {gradle-userguide}/maven_plugin.html -:maven-publish-plugin: {gradle-userguide}/maven_publish_plugin.html -:software-component: {gradle-userguide}/software_model_extend.html -:kotlin-plugin: https://kotlinlang.org/docs/reference/using-gradle.html -:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{gradle-project-version} -:api-documentation: {spring-boot-docs}/gradle-plugin/api -:spring-boot-reference: {spring-boot-docs}/reference/htmlsingle -:spring-boot-api: {spring-boot-docs}/api/org/springframework/boot -:version-properties-appendix: {spring-boot-reference}/#dependency-versions-properties -:build-info-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.html -:boot-build-image-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.html -:boot-jar-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootJar.html -:boot-war-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootWar.html -:boot-run-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/run/BootRun.html -:github-code: https://github.com/spring-projects/spring-boot/tree/{github-tag} -:buildpacks-reference: https://buildpacks.io/docs -:paketo-reference: https://paketo.io/docs -:paketo-java-reference: {paketo-reference}/buildpacks/language-family-buildpacks/java -:nbt-gradle-plugin: https://graalvm.github.io/native-build-tools/{native-build-tools-version}/gradle-plugin.html - - - -include::introduction.adoc[leveloffset=+1] - -include::getting-started.adoc[leveloffset=+1] - -include::managing-dependencies.adoc[leveloffset=+1] - -include::packaging.adoc[leveloffset=+1] - -include::packaging-oci-image.adoc[leveloffset=+1] - -include::publishing.adoc[leveloffset=+1] - -include::running.adoc[leveloffset=+1] - -include::aot.adoc[leveloffset=+1] - -include::integrating-with-actuator.adoc[leveloffset=+1] - -include::reacting.adoc[leveloffset=+1] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/aot/apply-native-image-plugin.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/aot/apply-native-image-plugin.gradle deleted file mode 100644 index 3e25cb898c..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/aot/apply-native-image-plugin.gradle +++ /dev/null @@ -1,5 +0,0 @@ -plugins { - id 'org.springframework.boot' version '{gradle-project-version}' - id 'org.graalvm.buildtools.native' version '{native-build-tools-version}' - id 'java' -} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/aot/apply-native-image-plugin.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/aot/apply-native-image-plugin.gradle.kts deleted file mode 100644 index 27dba95925..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/aot/apply-native-image-plugin.gradle.kts +++ /dev/null @@ -1,5 +0,0 @@ -plugins { - id("org.springframework.boot") version "{gradle-project-version}" - id("org.graalvm.buildtools.native") version "{native-build-tools-version}" - java -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle deleted file mode 100644 index eea03ac0f6..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id 'org.springframework.boot' version '{gradle-project-version}' -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle.kts deleted file mode 100644 index fead5b05c8..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id("org.springframework.boot") version "{gradle-project-version}" -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle deleted file mode 100644 index 88fba72d15..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id 'org.springframework.boot' version '{gradle-project-version}' apply false -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts deleted file mode 100644 index 5bebec31c3..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id("org.springframework.boot") version "{gradle-project-version}" apply false -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/Examples.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/Examples.java new file mode 100644 index 0000000000..36706d3400 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/Examples.java @@ -0,0 +1,29 @@ +/* + * Copyright 2012-2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.gradle.docs; + +/** + * @author Phillip Webb + */ +final class Examples { + + static final String DIR = "src/docs/antora/modules/gradle-plugin/examples/"; + + private Examples() { + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java index 4295db3827..f7e01c1691 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ class GettingStartedDocumentationTests { @TestTemplate void typicalPluginsAppliesExceptedPlugins() { - this.gradleBuild.script("src/docs/gradle/getting-started/typical-plugins").build("verify"); + this.gradleBuild.script(Examples.DIR + "getting-started/typical-plugins").build("verify"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java index 8483a52d79..29a0cf428c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,14 +42,14 @@ class IntegratingWithActuatorDocumentationTests { @TestTemplate void basicBuildInfo() { - this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-basic").build("bootBuildInfo"); + this.gradleBuild.script(Examples.DIR + "integrating-with-actuator/build-info-basic").build("bootBuildInfo"); assertThat(new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties")) .isFile(); } @TestTemplate void buildInfoCustomValues() { - this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-custom-values") + this.gradleBuild.script(Examples.DIR + "integrating-with-actuator/build-info-custom-values") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); assertThat(file).isFile(); @@ -63,7 +63,7 @@ class IntegratingWithActuatorDocumentationTests { @TestTemplate void buildInfoAdditional() { - this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-additional") + this.gradleBuild.script(Examples.DIR + "integrating-with-actuator/build-info-additional") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); assertThat(file).isFile(); @@ -74,7 +74,7 @@ class IntegratingWithActuatorDocumentationTests { @TestTemplate void buildInfoExcludeTime() { - this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-exclude-time") + this.gradleBuild.script(Examples.DIR + "integrating-with-actuator/build-info-exclude-time") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); assertThat(file).isFile(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java index e33ee06b03..7e16f78345 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,19 +39,19 @@ class ManagingDependenciesDocumentationTests { @TestTemplate void dependenciesExampleEvaluatesSuccessfully() { - this.gradleBuild.script("src/docs/gradle/managing-dependencies/dependencies").build(); + this.gradleBuild.script(Examples.DIR + "managing-dependencies/dependencies").build(); } @TestTemplate void customManagedVersions() { - assertThat(this.gradleBuild.script("src/docs/gradle/managing-dependencies/custom-version") + assertThat(this.gradleBuild.script(Examples.DIR + "managing-dependencies/custom-version") .build("slf4jVersion") .getOutput()).contains("1.7.20"); } @TestTemplate void dependencyManagementInIsolation() { - assertThat(this.gradleBuild.script("src/docs/gradle/managing-dependencies/configure-bom") + assertThat(this.gradleBuild.script(Examples.DIR + "managing-dependencies/configure-bom") .build("dependencyManagement") .getOutput()).contains("org.springframework.boot:spring-boot-starter "); } @@ -60,7 +60,7 @@ class ManagingDependenciesDocumentationTests { void dependencyManagementInIsolationWithPluginsBlock() { assumingThat(this.gradleBuild.getDsl() == Dsl.KOTLIN, () -> assertThat( - this.gradleBuild.script("src/docs/gradle/managing-dependencies/configure-bom-with-plugins") + this.gradleBuild.script(Examples.DIR + "managing-dependencies/configure-bom-with-plugins") .build("dependencyManagement") .getOutput()) .contains("org.springframework.boot:spring-boot-starter TEST-SNAPSHOT")); @@ -68,14 +68,14 @@ class ManagingDependenciesDocumentationTests { @TestTemplate void configurePlatform() { - assertThat(this.gradleBuild.script("src/docs/gradle/managing-dependencies/configure-platform") + assertThat(this.gradleBuild.script(Examples.DIR + "managing-dependencies/configure-platform") .build("dependencies", "--configuration", "compileClasspath") .getOutput()).contains("org.springframework.boot:spring-boot-starter "); } @TestTemplate void customManagedVersionsWithPlatform() { - assertThat(this.gradleBuild.script("src/docs/gradle/managing-dependencies/custom-version-with-platform") + assertThat(this.gradleBuild.script(Examples.DIR + "managing-dependencies/custom-version-with-platform") .build("dependencies", "--configuration", "compileClasspath") .getOutput()).contains("1.7.20"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java index d9cfc3d492..fcb13ba129 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,12 +52,12 @@ class PackagingDocumentationTests { @TestTemplate void warContainerDependencyEvaluatesSuccessfully() { - this.gradleBuild.script("src/docs/gradle/packaging/war-container-dependency").build(); + this.gradleBuild.script(Examples.DIR + "packaging/war-container-dependency").build(); } @TestTemplate void bootJarMainClass() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-main-class").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -69,7 +69,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarManifestMainClass() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-manifest-main-class").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-manifest-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -81,7 +81,7 @@ class PackagingDocumentationTests { @TestTemplate void applicationPluginMainClass() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/application-plugin-main-class").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/application-plugin-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -93,7 +93,7 @@ class PackagingDocumentationTests { @TestTemplate void springBootDslMainClass() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/spring-boot-dsl-main-class").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/spring-boot-dsl-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -106,7 +106,7 @@ class PackagingDocumentationTests { @TestTemplate void bootWarIncludeDevtools() throws IOException { jarFile(new File(this.gradleBuild.getProjectDir(), "spring-boot-devtools-1.2.3.RELEASE.jar")); - this.gradleBuild.script("src/docs/gradle/packaging/boot-war-include-devtools").build("bootWar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-war-include-devtools").build("bootWar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".war"); assertThat(file).isFile(); @@ -117,7 +117,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarRequiresUnpack() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-requires-unpack").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-requires-unpack").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -130,7 +130,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarIncludeLaunchScript() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-include-launch-script").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-include-launch-script").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -139,7 +139,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarLaunchScriptProperties() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-launch-script-properties").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-launch-script-properties").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -151,7 +151,7 @@ class PackagingDocumentationTests { File customScriptFile = new File(this.gradleBuild.getProjectDir(), "src/custom.script"); customScriptFile.getParentFile().mkdirs(); FileCopyUtils.copy("custom", new FileWriter(customScriptFile)); - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-custom-launch-script").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-custom-launch-script").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -160,7 +160,7 @@ class PackagingDocumentationTests { @TestTemplate void bootWarPropertiesLauncher() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-war-properties-launcher").build("bootWar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-war-properties-launcher").build("bootWar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".war"); assertThat(file).isFile(); @@ -172,7 +172,7 @@ class PackagingDocumentationTests { @TestTemplate void onlyBootJar() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/only-boot-jar").build("assemble"); + this.gradleBuild.script(Examples.DIR + "packaging/only-boot-jar").build("assemble"); File plainJar = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + "-plain.jar"); assertThat(plainJar).doesNotExist(); @@ -186,7 +186,7 @@ class PackagingDocumentationTests { @TestTemplate void classifiedBootJar() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-and-jar-classifiers").build("assemble"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-and-jar-classifiers").build("assemble"); File plainJar = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(plainJar).isFile(); @@ -203,7 +203,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarLayeredDisabled() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-layered-disabled").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-layered-disabled").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -215,7 +215,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarLayeredCustom() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-layered-custom").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-layered-custom").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -231,7 +231,7 @@ class PackagingDocumentationTests { @TestTemplate void bootJarLayeredExcludeTools() throws IOException { - this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-layered-exclude-tools").build("bootJar"); + this.gradleBuild.script(Examples.DIR + "packaging/boot-jar-layered-exclude-tools").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -247,21 +247,21 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithBuilder() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-builder") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-builder") .build("bootBuildImageBuilder"); assertThat(result.getOutput()).contains("builder=mine/java-cnb-builder").contains("runImage=mine/java-cnb-run"); } @TestTemplate void bootBuildImageWithCustomBuildpackJvmVersion() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-env") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-env") .build("bootBuildImageEnvironment"); assertThat(result.getOutput()).contains("BP_JVM_VERSION=17"); } @TestTemplate void bootBuildImageWithCustomProxySettings() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-env-proxy") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-env-proxy") .build("bootBuildImageEnvironment"); assertThat(result.getOutput()).contains("HTTP_PROXY=http://proxy.example.com") .contains("HTTPS_PROXY=https://proxy.example.com"); @@ -269,7 +269,7 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithCustomRuntimeConfiguration() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-env-runtime") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-env-runtime") .build("bootBuildImageEnvironment"); assertThat(result.getOutput()).contains("BPE_DELIM_JAVA_TOOL_OPTIONS= ") .contains("BPE_APPEND_JAVA_TOOL_OPTIONS=-XX:+HeapDumpOnOutOfMemoryError"); @@ -277,14 +277,14 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithCustomImageName() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-name") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-name") .build("bootBuildImageName"); assertThat(result.getOutput()).contains("example.com/library/" + this.gradleBuild.getProjectDir().getName()); } @TestTemplate void bootBuildImageWithDockerHostMinikube() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-host") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-docker-host") .build("bootBuildImageDocker"); assertThat(result.getOutput()).contains("host=tcp://192.168.99.100:2376") .contains("tlsVerify=true") @@ -293,7 +293,7 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithDockerHostPodman() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-host-podman") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-docker-host-podman") .build("bootBuildImageDocker"); assertThat(result.getOutput()).contains("host=unix:///run/user/1000/podman/podman.sock") .contains("bindHostToBuilder=true"); @@ -301,7 +301,7 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithDockerHostColima() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-host-colima") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-docker-host-colima") .build("bootBuildImageDocker"); assertThat(result.getOutput()) .contains("host=unix://" + System.getProperty("user.home") + "/.colima/docker.sock"); @@ -309,7 +309,7 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithDockerUserAuth() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-auth-user") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-docker-auth-user") .build("bootBuildImageDocker"); assertThat(result.getOutput()).contains("username=user") .contains("password=secret") @@ -319,21 +319,21 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithDockerTokenAuth() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-docker-auth-token") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-docker-auth-token") .build("bootBuildImageDocker"); assertThat(result.getOutput()).contains("token=9cbaf023786cd7..."); } @TestTemplate void bootBuildImagePublish() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-publish") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-publish") .build("bootBuildImagePublish"); assertThat(result.getOutput()).contains("true"); } @TestTemplate void bootBuildImageWithBuildpacks() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-buildpacks") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-buildpacks") .build("bootBuildImageBuildpacks"); assertThat(result.getOutput()).contains("file:///path/to/example-buildpack.tgz") .contains("urn:cnb:builder:paketo-buildpacks/java"); @@ -341,7 +341,7 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithCaches() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-caches") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-caches") .build("bootBuildImageCaches"); assertThat(result.getOutput()).containsPattern("buildCache=cache-gradle-[\\d]+.build") .containsPattern("launchCache=cache-gradle-[\\d]+.launch"); @@ -349,7 +349,7 @@ class PackagingDocumentationTests { @TestTemplate void bootBuildImageWithBindCaches() { - BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-bind-caches") + BuildResult result = this.gradleBuild.script(Examples.DIR + "packaging/boot-build-image-bind-caches") .build("bootBuildImageCaches"); assertThat(result.getOutput()).containsPattern("buildWorkspace=/tmp/cache-gradle-[\\d]+.work") .containsPattern("buildCache=/tmp/cache-gradle-[\\d]+.build") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java index 10ff323e83..71ccbad567 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ class PublishingDocumentationTests { @TestTemplate void mavenPublish() { - assertThat(this.gradleBuild.script("src/docs/gradle/publishing/maven-publish") + assertThat(this.gradleBuild.script(Examples.DIR + "publishing/maven-publish") .build("publishingConfiguration") .getOutput()).contains("MavenPublication").contains("https://repo.example.com"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java index 71833a8e38..b1471e09d6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,14 +43,14 @@ class RunningDocumentationTests { @TestTemplate void bootRunMain() throws IOException { writeMainClass(); - assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-main").build("bootRun").getOutput()) + assertThat(this.gradleBuild.script(Examples.DIR + "running/boot-run-main").build("bootRun").getOutput()) .contains("com.example.ExampleApplication"); } @TestTemplate void applicationPluginMainClassName() throws IOException { writeMainClass(); - assertThat(this.gradleBuild.script("src/docs/gradle/running/application-plugin-main-class-name") + assertThat(this.gradleBuild.script(Examples.DIR + "running/application-plugin-main-class-name") .build("bootRun") .getOutput()).contains("com.example.ExampleApplication"); } @@ -58,35 +58,35 @@ class RunningDocumentationTests { @TestTemplate void springBootDslMainClassName() throws IOException { writeMainClass(); - assertThat(this.gradleBuild.script("src/docs/gradle/running/spring-boot-dsl-main-class-name") + assertThat(this.gradleBuild.script(Examples.DIR + "running/spring-boot-dsl-main-class-name") .build("bootRun") .getOutput()).contains("com.example.ExampleApplication"); } @TestTemplate void bootRunSourceResources() { - assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-source-resources") + assertThat(this.gradleBuild.script(Examples.DIR + "running/boot-run-source-resources") .build("configuredClasspath") .getOutput()).contains(new File("src/main/resources").getPath()); } @TestTemplate void bootRunDisableOptimizedLaunch() { - assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-disable-optimized-launch") + assertThat(this.gradleBuild.script(Examples.DIR + "running/boot-run-disable-optimized-launch") .build("optimizedLaunch") .getOutput()).contains("false"); } @TestTemplate void bootRunSystemPropertyDefaultValue() { - assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-system-property") + assertThat(this.gradleBuild.script(Examples.DIR + "running/boot-run-system-property") .build("configuredSystemProperties") .getOutput()).contains("com.example.property = default"); } @TestTemplate void bootRunSystemProperty() { - assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-system-property") + assertThat(this.gradleBuild.script(Examples.DIR + "running/boot-run-system-property") .build("-Pexample=custom", "configuredSystemProperties") .getOutput()).contains("com.example.property = custom"); }