diff --git a/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java b/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java index 475a57206719..56f522e279ed 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/antora/AntoraAsciidocAttributes.java @@ -32,6 +32,8 @@ import org.springframework.boot.build.artifacts.ArtifactRelease; import org.springframework.boot.build.bom.BomExtension; import org.springframework.boot.build.bom.Library; +import org.springframework.boot.build.properties.BuildProperties; +import org.springframework.boot.build.properties.BuildType; import org.springframework.util.Assert; /** @@ -47,6 +49,8 @@ public class AntoraAsciidocAttributes { private final boolean latestVersion; + private final BuildType buildType; + private final ArtifactRelease artifactRelease; private final List libraries; @@ -59,16 +63,18 @@ public AntoraAsciidocAttributes(Project project, BomExtension dependencyBom, Map dependencyVersions) { this.version = String.valueOf(project.getVersion()); this.latestVersion = Boolean.parseBoolean(String.valueOf(project.findProperty("latestVersion"))); + this.buildType = BuildProperties.get(project).buildType(); this.artifactRelease = ArtifactRelease.forProject(project); this.libraries = dependencyBom.getLibraries(); this.dependencyVersions = dependencyVersions; this.projectProperties = project.getProperties(); } - AntoraAsciidocAttributes(String version, boolean latestVersion, List libraries, + AntoraAsciidocAttributes(String version, boolean latestVersion, BuildType buildType, List libraries, Map dependencyVersions, Map projectProperties) { this.version = version; this.latestVersion = latestVersion; + this.buildType = buildType; this.artifactRelease = ArtifactRelease.forVersion(version); this.libraries = (libraries != null) ? libraries : Collections.emptyList(); this.dependencyVersions = (dependencyVersions != null) ? dependencyVersions : Collections.emptyMap(); @@ -77,6 +83,7 @@ public AntoraAsciidocAttributes(Project project, BomExtension dependencyBom, public Map get() { Map attributes = new LinkedHashMap<>(); + addBuildTypeAttribute(attributes); addGitHubAttributes(attributes); addVersionAttributes(attributes); addArtifactAttributes(attributes); @@ -86,6 +93,10 @@ public Map get() { return attributes; } + private void addBuildTypeAttribute(Map attributes) { + attributes.put("build-type", this.buildType.toIdentifier()); + } + private void addGitHubAttributes(Map attributes) { attributes.put("github-repo", "spring-projects/spring-boot"); attributes.put("github-ref", determineGitHubRef()); @@ -152,6 +163,8 @@ private String getVersion(String groupAndArtifactId) { private void addArtifactAttributes(Map attributes) { attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo()); attributes.put("artifact-release-type", this.artifactRelease.getType()); + attributes.put("build-and-artifact-release-type", + this.buildType.toIdentifier() + "-" + this.artifactRelease.getType()); } private void addUrlJava(Map attributes) { @@ -177,8 +190,7 @@ public synchronized Object put(Object key, Object value) { }; try (InputStream in = getClass().getResourceAsStream("antora-asciidoc-attributes.properties")) { properties.load(in); - } - catch (IOException ex) { + } catch (IOException ex) { throw new UncheckedIOException(ex); } } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/properties/BuildType.java b/buildSrc/src/main/java/org/springframework/boot/build/properties/BuildType.java index 420e6ed6f4c6..fa430dda445c 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/properties/BuildType.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/properties/BuildType.java @@ -31,6 +31,10 @@ public enum BuildType { /** * A commercial build. */ - COMMERCIAL + COMMERCIAL; + + public String toIdentifier() { + return toString().replace("_", "").toLowerCase(); + } } diff --git a/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java b/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java index dbba3f414ab6..3d4451e33ea5 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java @@ -31,6 +31,7 @@ import org.springframework.boot.build.bom.Library.ProhibitedVersion; import org.springframework.boot.build.bom.Library.VersionAlignment; import org.springframework.boot.build.bom.bomr.version.DependencyVersion; +import org.springframework.boot.build.properties.BuildType; import static org.assertj.core.api.Assertions.assertThat; @@ -42,45 +43,59 @@ */ class AntoraAsciidocAttributesTests { + @Test + void buildTypeWhenOpenSource() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, + mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("build-type", "opensource"); + } + + @Test + void buildTypeWhenCommercial() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.COMMERCIAL, null, + mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("build-type", "commercial"); + } + @Test void githubRefWhenReleasedVersionIsTag() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("github-ref", "v1.2.3"); } @Test void githubRefWhenLatestSnapshotVersionIsMainBranch() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null, - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, + BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("github-ref", "main"); } @Test void githubRefWhenOlderSnapshotVersionIsBranch() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", false, null, - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", false, + BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("github-ref", "1.2.x"); } @Test void githubRefWhenOlderSnapshotHotFixVersionIsBranch() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, null, - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, + BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("github-ref", "1.2.3.x"); } @Test void versionReferenceFromLibrary() { Library library = mockLibrary(Collections.emptyMap()); - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, List.of(library), - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, + BuildType.OPEN_SOURCE, List.of(library), mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("version-spring-framework", "1.2.3"); } @Test void versionReferenceFromSpringDataDependencyReleaseVersion() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, mockDependencyVersions("3.2.5"), null); assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-docs", "3.2"); assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-javadoc", "3.2.x"); @@ -88,7 +103,7 @@ void versionReferenceFromSpringDataDependencyReleaseVersion() { @Test void versionReferenceFromSpringDataDependencySnapshotVersion() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, mockDependencyVersions("3.2.0-SNAPSHOT"), null); assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-docs", "3.2-SNAPSHOT"); assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-javadoc", "3.2.x"); @@ -96,51 +111,78 @@ void versionReferenceFromSpringDataDependencySnapshotVersion() { @Test void versionNativeBuildTools() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, mockDependencyVersions(), Map.of("nativeBuildToolsVersion", "3.4.5")); assertThat(attributes.get()).containsEntry("version-native-build-tools", "3.4.5"); } @Test void urlArtifactRepositoryWhenRelease() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.maven.apache.org/maven2"); } @Test void urlArtifactRepositoryWhenMilestone() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null, - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, BuildType.OPEN_SOURCE, + null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/milestone"); } @Test void urlArtifactRepositoryWhenSnapshot() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null, - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, + BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot"); } @Test - void artifactReleaseTypeWhenRelease() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + void artifactReleaseTypeWhenOpenSourceRelease() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("artifact-release-type", "release"); + assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "opensource-release"); } @Test - void artifactReleaseTypeWhenMilestone() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null, - mockDependencyVersions(), null); + void artifactReleaseTypeWhenOpenSourceMilestone() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, BuildType.OPEN_SOURCE, + null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone"); + assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "opensource-milestone"); } @Test - void artifactReleaseTypeWhenSnapshot() { - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null, + void artifactReleaseTypeWhenOpenSourceSnapshot() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, + BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot"); + assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "opensource-snapshot"); + } + + @Test + void artifactReleaseTypeWhenCommercialRelease() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.COMMERCIAL, null, + mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("artifact-release-type", "release"); + assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "commercial-release"); + } + + @Test + void artifactReleaseTypeWhenCommercialMilestone() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, BuildType.COMMERCIAL, null, mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone"); + assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "commercial-milestone"); + } + + @Test + void artifactReleaseTypeWhenCommercialSnapshot() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, BuildType.COMMERCIAL, + null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot"); + assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "commercial-snapshot"); } @Test @@ -149,16 +191,16 @@ void urlLinksFromLibrary() { links.put("site", (version) -> "https://example.com/site/" + version); links.put("docs", (version) -> "https://example.com/docs/" + version); Library library = mockLibrary(links); - AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, List.of(library), - mockDependencyVersions(), null); + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, + BuildType.OPEN_SOURCE, List.of(library), mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-spring-framework-site", "https://example.com/site/1.2.3") .containsEntry("url-spring-framework-docs", "https://example.com/docs/1.2.3"); } @Test void linksFromProperties() { - Map attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null, - mockDependencyVersions(), null) + Map attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, BuildType.OPEN_SOURCE, + null, mockDependencyVersions(), null) .get(); assertThat(attributes).containsEntry("include-java", "ROOT:example$java/org/springframework/boot/docs"); assertThat(attributes).containsEntry("url-spring-data-cassandra-site", diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/tutorial/pages/first-application/index.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/tutorial/pages/first-application/index.adoc index a6a26ab0d56e..a9586e407bfb 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/tutorial/pages/first-application/index.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/tutorial/pages/first-application/index.adoc @@ -100,34 +100,61 @@ Open your favorite text editor and add the following: -ifeval::["{artifact-release-type}" != "release"] - - - - spring-snapshots - https://repo.spring.io/snapshot - true - - - spring-milestones - https://repo.spring.io/milestone - - - - - spring-snapshots - https://repo.spring.io/snapshot - - - spring-milestones - https://repo.spring.io/milestone - - +ifeval::["{build-and-artifact-release-type}" == "opensource-milestone"] + + + + spring-milestones + https://repo.spring.io/milestone + + + + + spring-milestones + https://repo.spring.io/milestone + + +endif::[] +ifeval::["{build-and-artifact-release-type}" == "opensource-snapshot"] + + + + spring-snapshots + https://repo.spring.io/snapshot + true + + + spring-milestones + https://repo.spring.io/milestone + + + + + spring-snapshots + https://repo.spring.io/snapshot + + + spring-milestones + https://repo.spring.io/milestone + + endif::[] ---- +ifeval::["{build-type}" == "opensource"] The preceding listing should give you a working build. +endif::[] + +ifeval::["{build-type}" == "commercial"] +You will also have to configure your build to access the Spring Commercial 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 the addition of the necessary repository configuration, the preceding listing should give you a working build. +endif::[] + You can test it by running `mvn package` (for now, you can ignore the "`jar will be empty - no content was marked for inclusion!`" warning). NOTE: At this point, you could import the project into an IDE (most modern Java IDEs include built-in support for Maven). diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-commercial.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-commercial.gradle new file mode 100644 index 000000000000..eea03ac0f688 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-commercial.gradle @@ -0,0 +1,3 @@ +plugins { + id 'org.springframework.boot' version '{gradle-project-version}' +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-commercial.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-commercial.gradle.kts new file mode 100644 index 000000000000..fead5b05c83c --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-commercial.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.springframework.boot") version "{gradle-project-version}" +} 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-commercial.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-commercial.gradle new file mode 100644 index 000000000000..88fba72d152b --- /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-commercial.gradle @@ -0,0 +1,3 @@ +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/antora/modules/gradle-plugin/examples/managing-dependencies/depend-on-plugin-commercial.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-commercial.gradle.kts new file mode 100644 index 000000000000..5bebec31c3f8 --- /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-commercial.gradle.kts @@ -0,0 +1,3 @@ +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/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 index bc55314e63f0..5e923ee0d1e2 100644 --- 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 @@ -3,7 +3,34 @@ 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: + +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$getting-started/apply-plugin-commercial.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$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: [tabs] @@ -23,7 +50,7 @@ include::example$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): @@ -63,7 +90,7 @@ include::example$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): diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc index d0c9cf033a46..1955207a68bd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/pages/managing-dependencies.adoc @@ -70,7 +70,25 @@ 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"] +[tabs] +====== +Groovy:: ++ +[source,groovy,indent=0,subs="verbatim,attributes"] +---- +include::example$managing-dependencies/depend-on-plugin-commercial.gradle[] +---- +Kotlin:: ++ +[source,kotlin,indent=0,subs="verbatim,attributes"] +---- +include::example$managing-dependencies/depend-on-plugin-commercial.gradle.kts[] +---- +====== +endif::[] + +ifeval::["{build-and-artifact-release-type}" == "opensource-release"] [tabs] ====== Groovy:: @@ -88,7 +106,7 @@ include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[] ====== endif::[] -ifeval::["{artifact-release-type}" == "milestone"] +ifeval::["{build-and-artifact-release-type}" == "opensource-milestone"] [tabs] ====== Groovy:: @@ -106,7 +124,7 @@ include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[] ====== endif::[] -ifeval::["{artifact-release-type}" == "snapshot"] +ifeval::["{build-and-artifact-release-type}" == "opensource-snapshot"] [tabs] ====== Groovy:: diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/antora/modules/maven-plugin/pages/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/antora/modules/maven-plugin/pages/getting-started.adoc index 61a577d430ed..4d74580e3353 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/antora/modules/maven-plugin/pages/getting-started.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/antora/modules/maven-plugin/pages/getting-started.adoc @@ -8,9 +8,19 @@ To use the Spring Boot Maven Plugin, include the appropriate XML in the `plugins include::example$getting-started/pom.xml[tags=getting-started] ---- +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 usually 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. +endif::[] + +ifeval::["{build-type}" == "opensource"] If you use a milestone or snapshot release, you also need to add the appropriate `pluginRepository` elements, as shown in the following listing: [source,xml,indent=0,subs="verbatim,attributes"] ---- include::example$getting-started/plugin-repositories-pom.xml[tags=plugin-repositories] ---- +endif::[]