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 7526f89a3969..6745386e1da5 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 @@ -77,7 +77,7 @@ public Map get() { Map attributes = new LinkedHashMap<>(); addGitHubAttributes(attributes); addVersionAttributes(attributes); - addUrlArtifactRepository(attributes); + addArtifactAttributes(attributes); addUrlJava(attributes); addUrlLibraryLinkAttributes(attributes); addPropertyAttributes(attributes); @@ -139,8 +139,9 @@ private void addDependencyVersion(Map attributes, String name, S attributes.put("version-" + name, version); } - private void addUrlArtifactRepository(Map attributes) { + private void addArtifactAttributes(Map attributes) { attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo()); + attributes.put("artifact-release-type", this.artifactRelease.getType()); } private void addUrlJava(Map attributes) { 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 c8c2b8d6f37c..65ccedc0c245 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 @@ -112,6 +112,27 @@ void urlArtifactRepositoryWhenSnapshot() { assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot"); } + @Test + void artifactReleaseTypeWhenRelease() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, + mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("artifact-release-type", "release"); + } + + @Test + void artifactReleaseTypeWhenMilestone() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null, + mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone"); + } + + @Test + void artifactReleaseTypeWhenSnapshot() { + AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null, + mockDependencyVersions(), null); + assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot"); + } + @Test void urlLinksFromLibrary() { Map> links = new LinkedHashMap<>();