Use ifeval block for Commercial/OSS documentation

See gh-42333
This commit is contained in:
Phillip Webb
2024-09-30 14:45:47 -07:00
parent 7f8fe4251d
commit 05b4edfd2c
10 changed files with 105 additions and 9 deletions

View File

@@ -2,7 +2,28 @@
= Getting Started
To get started with the plugin it needs to be applied to your project.
ifeval::["{artifact-release-type}" == "release"]
ifeval::["{build-type}" == "commercial"]
The plugin is published to the Spring Commercial repository.
You will have to configure your build to access this repository.
This is usual done through a local artifact repository that mirrors the content of the Spring Commercial repository.
Alternatively, while it is not recommended, the Spring Commercial repository can also be accessed directly.
In either case, see https://docs.vmware.com/en/Tanzu-Spring-Runtime/Commercial/Tanzu-Spring-Runtime/spring-enterprise-subscription.html[the Tanzu Spring Runtime documentation] for further details.
With access to the Spring Commercial repository configured in `settings.gradle` or `settings.gradle.kts`, the plugin can be applied using the `plugins` block:
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
include::../gradle/getting-started/apply-plugin-commercial.gradle[]
----
[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin
----
include::../gradle/getting-started/apply-plugin-commercial.gradle.kts[]
----
endif::[]
ifeval::["{build-and-artifact-release-type}" == "opensource-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
@@ -16,7 +37,8 @@ include::../gradle/getting-started/apply-plugin-release.gradle[]
include::../gradle/getting-started/apply-plugin-release.gradle.kts[]
----
endif::[]
ifeval::["{artifact-release-type}" == "milestone"]
ifeval::["{build-and-artifact-release-type}" == "opensource-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):
@@ -47,7 +69,8 @@ include::../gradle/getting-started/apply-plugin-release.gradle[]
include::../gradle/getting-started/apply-plugin-release.gradle.kts[]
----
endif::[]
ifeval::["{artifact-release-type}" == "snapshot"]
ifeval::["{build-and-artifact-release-type}" == "opensource-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):

View File

@@ -58,7 +58,21 @@ The `SpringBootPlugin` class provides a `BOM_COORDINATES` constant that can be u
First, configure the project to depend on the Spring Boot plugin but do not apply it:
ifeval::["{artifact-release-type}" == "release"]
ifeval::["{build-type}" == "commercial"]
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
include::../gradle/managing-dependencies/depend-on-plugin-commercial.gradle[]
----
[source,kotlin,indent=0,subs="verbatim,attributes",role="secondary"]
.Kotlin
----
include::../gradle/managing-dependencies/depend-on-plugin-commercial.gradle.kts[]
----
endif::[]
ifeval::["{build-and-artifact-release-type}" == "opensource-release"]
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
@@ -71,7 +85,8 @@ include::../gradle/managing-dependencies/depend-on-plugin-release.gradle[]
include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[]
----
endif::[]
ifeval::["{artifact-release-type}" == "milestone"]
ifeval::["{build-and-artifact-release-type}" == "opensource-milestone"]
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----
@@ -83,7 +98,8 @@ include::../gradle/managing-dependencies/depend-on-plugin-milestone.gradle[]
include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[]
----
endif::[]
ifeval::["{artifact-release-type}" == "snapshot"]
ifeval::["{build-and-artifact-release-type}" == "opensource-snapshot"]
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
.Groovy
----

View File

@@ -0,0 +1,3 @@
plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

View File

@@ -0,0 +1,3 @@
plugins {
id("org.springframework.boot") version "{gradle-project-version}"
}

View File

@@ -0,0 +1,3 @@
plugins {
id 'org.springframework.boot' version '{gradle-project-version}' apply false
}

View File

@@ -0,0 +1,3 @@
plugins {
id("org.springframework.boot") version "{gradle-project-version}" apply false
}