Use module DSL for Pulsar Antora attributes

Replace custom attributes and processing logic with the module
links DSL.

See gh-51498
This commit is contained in:
Phillip Webb
2026-09-04 13:21:38 -07:00
parent 0eb25c7d30
commit 4b2c0d2852
3 changed files with 3 additions and 20 deletions
@@ -37,7 +37,6 @@ import org.springframework.boot.build.bom.ResolvedBom;
import org.springframework.boot.build.bom.ResolvedBom.ResolvedLibrary;
import org.springframework.boot.build.properties.BuildProperties;
import org.springframework.boot.build.properties.BuildType;
import org.springframework.util.Assert;
/**
* Generates Asciidoctor attributes for use with Antora.
@@ -60,8 +59,6 @@ public class AntoraAsciidocAttributes {
private final ResolvedBom resolvedBom;
private final Map<String, String> dependencyVersions;
private final Map<String, ?> projectProperties;
public AntoraAsciidocAttributes(Project project, BomExtension dependencyBom, ResolvedBom resolvedBom) {
@@ -71,7 +68,6 @@ public class AntoraAsciidocAttributes {
this.artifactRelease = ArtifactRelease.forProject(project);
this.libraries = dependencyBom.getLibraries();
this.resolvedBom = resolvedBom;
this.dependencyVersions = resolvedBom.dependencyVersions();
this.projectProperties = project.getProperties();
}
@@ -114,7 +110,6 @@ public class AntoraAsciidocAttributes {
this.libraries.forEach((library) -> addVersionAttributes(attributes, library));
attributes.put("version-native-build-tools", (String) this.projectProperties.get("nativeBuildToolsVersion"));
attributes.put("version-graal", (String) this.projectProperties.get("graalVersion"));
addDependencyVersion(attributes, "pulsar-client-api", "org.apache.pulsar:pulsar-client-api");
}
private void addVersionAttributes(Map<String, String> attributes, Library library) {
@@ -126,16 +121,6 @@ public class AntoraAsciidocAttributes {
});
}
private void addDependencyVersion(Map<String, String> attributes, String name, String groupAndArtifactId) {
attributes.put("version-" + name, getVersion(groupAndArtifactId));
}
private String getVersion(String groupAndArtifactId) {
String version = this.dependencyVersions.get(groupAndArtifactId);
Assert.notNull(version, () -> "No version found for " + groupAndArtifactId);
return version;
}
private void addArtifactAttributes(Map<String, String> attributes) {
attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo());
attributes.put("artifact-release-type", this.artifactRelease.getType());
@@ -35,11 +35,6 @@ url-native-build-tools-docs-gradle-plugin={url-native-build-tools-docs}/gradle-p
url-native-build-tools-docs-maven-plugin={url-native-build-tools-docs}/maven-plugin.html
url-paketo-docs=https://paketo.io/docs
url-paketo-docs-java-buildpack={url-paketo-docs}/buildpacks/language-family-buildpacks/java
url-pulsar-client-api-javadoc=https://javadoc.io/doc/org.apache.pulsar/pulsar-client-api/{version-pulsar-client-api}
# === Javadoc Locations ===
javadoc-location-org-apache-pulsar-client-api={url-pulsar-client-api-javadoc}
# === API References ===
@@ -1885,6 +1885,9 @@ bom {
docs(version -> "https://pulsar.apache.org/docs/%s.%s.x"
.formatted(version.major(), version.minor()))
releaseNotes("https://pulsar.apache.org/release-notes/versioned/pulsar-{version}")
module("pulsar-client-api") {
javadoc("https://javadoc.io/doc/org.apache.pulsar/pulsar-client-api/{version}", "org.apache.pulsar.client.api")
}
}
}
library("Quartz", "2.5.2") {