From a3b027a6f19cbc2dd2537f33a45f601ea7169365 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 19 Nov 2024 23:05:40 -0800 Subject: [PATCH] Add more javadoc links See gh-41614 --- .../antora/AntoraAsciidocAttributes.java | 33 ++++++++++- .../antora-asciidoc-attributes.properties | 22 ++++++++ .../antora/AntoraAsciidocAttributesTests.java | 24 ++++++++ .../spring-boot-dependencies/build.gradle | 55 ++++++++++++++++--- 4 files changed, 126 insertions(+), 8 deletions(-) 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 efa5262ce280..5773ce084dda 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 @@ -141,6 +141,26 @@ private void addVersionAttributes(Map attributes, Map attributes, Map internal, @@ -159,6 +179,11 @@ private void addSpringDataDependencyVersion(Map attributes, Map< internal.put("dotxversion-" + name, majorMinor + ".x"); } + private void addTestcontainersDependencyVersion(Map attributes, Map internal, + String artifactId) { + addDependencyVersion(attributes, "testcontainers-" + artifactId, "org.testcontainers:" + artifactId); + } + private void addDependencyVersion(Map attributes, String name, String groupAndArtifactId) { attributes.put("version-" + name, getVersion(groupAndArtifactId)); } @@ -178,9 +203,15 @@ private void addArtifactAttributes(Map attributes) { private void addUrlJava(Map attributes) { attributes.put("url-javase-javadoc", "https://docs.oracle.com/en/java/javase/17/docs/api/"); - attributes.put("javadoc-location-java-util", "{url-javase-javadoc}"); + attributes.put("javadoc-location-java-beans", "{url-javase-javadoc}"); attributes.put("javadoc-location-java-lang", "{url-javase-javadoc}"); + attributes.put("javadoc-location-java-net", "{url-javase-javadoc}"); + attributes.put("javadoc-location-java-io", "{url-javase-javadoc}"); + attributes.put("javadoc-location-java-time", "{url-javase-javadoc}"); + attributes.put("javadoc-location-java-util", "{url-javase-javadoc}"); attributes.put("javadoc-location-javax-management", "{url-javase-javadoc}"); + attributes.put("javadoc-location-javax-net", "{url-javase-javadoc}"); + attributes.put("javadoc-location-javax-sql", "{url-javase-javadoc}"); attributes.put("javadoc-location-javax-xml", "{url-javase-javadoc}"); } diff --git a/buildSrc/src/main/resources/org/springframework/boot/build/antora/antora-asciidoc-attributes.properties b/buildSrc/src/main/resources/org/springframework/boot/build/antora/antora-asciidoc-attributes.properties index b83ddededcae..aa3865b19429 100644 --- a/buildSrc/src/main/resources/org/springframework/boot/build/antora/antora-asciidoc-attributes.properties +++ b/buildSrc/src/main/resources/org/springframework/boot/build/antora/antora-asciidoc-attributes.properties @@ -33,6 +33,8 @@ 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} +url-pulsar-client-reactive-api-javadoc=https://javadoc.io/doc/org.apache.pulsar/pulsar-client-reactive-api/{version-pulsar-client-reactive-api} url-spring-boot-for-apache-geode-docs=https://docs.spring.io/spring-boot-data-geode-build/2.0.x/reference/html5 url-spring-boot-for-apache-geode-site=https://github.com/spring-projects/spring-boot-data-geode url-spring-data-cassandra-docs=https://docs.spring.io/spring-data/cassandra/reference/{antoraversion-spring-data-cassandra} @@ -72,6 +74,24 @@ url-spring-data-rest-docs=https://docs.spring.io/spring-data/rest/reference/{ant url-spring-data-rest-site=https://spring.io/projects/spring-data-rest url-spring-data-rest-javadoc=https://docs.spring.io/spring-data/rest/docs/{dotxversion-spring-data-rest}/api url-spring-data-site=https://spring.io/projects/spring-data +url-testcontainers-activemq-javadoc=https://javadoc.io/doc/org.testcontainers/activemq/{version-testcontainers-activemq} +url-testcontainers-cassandra-javadoc=https://javadoc.io/doc/org.testcontainers/cassandra/{version-testcontainers-cassandra} +url-testcontainers-couchbase-javadoc=https://javadoc.io/doc/org.testcontainers/couchbase/{version-testcontainers-couchbase} +url-testcontainers-elasticsearch-javadoc=https://javadoc.io/doc/org.testcontainers/elasticsearch/{version-testcontainers-elasticsearch} +url-testcontainers-jdbc-javadoc=https://javadoc.io/doc/org.testcontainers/jdbc/{version-testcontainers-jdbc} +url-testcontainers-kafka-javadoc=https://javadoc.io/doc/org.testcontainers/kafka/{version-testcontainers-kafka} +url-testcontainers-mariadb-javadoc=https://javadoc.io/doc/org.testcontainers/mariadb/{version-testcontainers-mariadb} +url-testcontainers-mongodb-javadoc=https://javadoc.io/doc/org.testcontainers/mongodb/{version-testcontainers-mongodb} +url-testcontainers-mssqlserver-javadoc=https://javadoc.io/doc/org.testcontainers/mssqlserver/{version-testcontainers-mssqlserver} +url-testcontainers-mysql-javadoc=https://javadoc.io/doc/org.testcontainers/mysql/{version-testcontainers-mysql} +url-testcontainers-neo4j-javadoc=https://javadoc.io/doc/org.testcontainers/neo4j/{version-testcontainers-neo4j} +url-testcontainers-oracle-xe-javadoc=https://javadoc.io/doc/org.testcontainers/oracle-xe/{version-testcontainers-oracle-xe} +url-testcontainers-oracle-free-javadoc=https://javadoc.io/doc/org.testcontainers/oracle-free/{version-testcontainers-oracle-free} +url-testcontainers-postgresql-javadoc=https://javadoc.io/doc/org.testcontainers/postgresql/{version-testcontainers-postgresql} +url-testcontainers-pulsar-javadoc=https://javadoc.io/doc/org.testcontainers/pulsar/{version-testcontainers-pulsar} +url-testcontainers-rabbitmq-javadoc=https://javadoc.io/doc/org.testcontainers/rabbitmq/{version-testcontainers-rabbitmq} +url-testcontainers-redpanda-javadoc=https://javadoc.io/doc/org.testcontainers/redpanda/{version-testcontainers-redpanda} +url-testcontainers-r2dbc-javadoc=https://javadoc.io/doc/org.testcontainers/r2dbc/{version-testcontainers-r2dbc} url-jackson-annotations-javadoc=https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/{version-jackson-annotations} url-jackson-core-javadoc=https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/{version-jackson-core} url-jackson-databind-javadoc=https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/{version-jackson-databind} @@ -79,6 +99,8 @@ url-jackson-dataformat-xml-javadoc=https://javadoc.io/doc/com.fasterxml.jackson. # === Javadoc Locations === +javadoc-location-org-apache-pulsar-client-api={url-pulsar-client-api-javadoc} +javadoc-location-org-apache-pulsar-reactive-client-api={url-pulsar-client-reactive-api-javadoc} javadoc-location-org-springframework-data-cassandra={url-spring-data-cassandra-javadoc} javadoc-location-org-springframework-data-querydsl={url-spring-data-commons-javadoc} javadoc-location-org-springframework-data-repository={url-spring-data-commons-javadoc} 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 75c92ae969f9..ed4ba952abda 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 @@ -260,9 +260,29 @@ private Map mockDependencyVersions(String version) { addMockSpringDataVersion(versions, "spring-data-redis", version); addMockSpringDataVersion(versions, "spring-data-rest-core", version); addMockSpringDataVersion(versions, "spring-data-ldap", version); + addMockTestcontainersVersion(versions, "activemq", version); + addMockTestcontainersVersion(versions, "cassandra", version); + addMockTestcontainersVersion(versions, "couchbase", version); + addMockTestcontainersVersion(versions, "elasticsearch", version); + addMockTestcontainersVersion(versions, "jdbc", version); + addMockTestcontainersVersion(versions, "kafka", version); + addMockTestcontainersVersion(versions, "mariadb", version); + addMockTestcontainersVersion(versions, "mongodb", version); + addMockTestcontainersVersion(versions, "mssqlserver", version); + addMockTestcontainersVersion(versions, "mysql", version); + addMockTestcontainersVersion(versions, "neo4j", version); + addMockTestcontainersVersion(versions, "oracle-xe", version); + addMockTestcontainersVersion(versions, "oracle-free", version); + addMockTestcontainersVersion(versions, "postgresql", version); + addMockTestcontainersVersion(versions, "pulsar", version); + addMockTestcontainersVersion(versions, "rabbitmq", version); + addMockTestcontainersVersion(versions, "redpanda", version); + addMockTestcontainersVersion(versions, "r2dbc", version); addMockJacksonCoreVersion(versions, "jackson-annotations", version); addMockJacksonCoreVersion(versions, "jackson-core", version); addMockJacksonCoreVersion(versions, "jackson-databind", version); + versions.put("org.apache.pulsar:pulsar-client-api", version); + versions.put("org.apache.pulsar:pulsar-client-reactive-api", version); versions.put("com.fasterxml.jackson.dataformat:jackson-dataformat-xml", version); return versions; } @@ -271,6 +291,10 @@ private void addMockSpringDataVersion(Map versions, String artif versions.put("org.springframework.data:" + artifactId, version); } + private void addMockTestcontainersVersion(Map versions, String artifactId, String version) { + versions.put("org.testcontainers:" + artifactId, version); + } + private void addMockJacksonCoreVersion(Map versions, String artifactId, String version) { versions.put("com.fasterxml.jackson.core:" + artifactId, version); } diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 7675a6aa0fa5..1e09c179bee1 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -260,7 +260,7 @@ bom { } links { site("https://docs.couchbase.com/java-sdk/current/hello-world/overview.html") - javadoc("https://javadoc.io/doc/com.couchbase.client/java-client/{version}") + javadoc("https://javadoc.io/doc/com.couchbase.client/java-client/{version}", "com.couchbase.client") releaseNotes("https://docs.couchbase.com/java-sdk/current/project-docs/sdk-release-notes.html") } } @@ -353,6 +353,9 @@ bom { } links { releaseNotes("https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-{version}.html") + javadoc("elasticsearch-rest-client", version -> "https://artifacts.elastic.co/javadoc/org/elasticsearch/client/elasticsearch-rest-client/%s".formatted(version), "org.elasticsearch.client") + javadoc("elasticsearch-java", version -> "https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/%s".formatted(version), "co.elastic.clients.elasticsearch", "co.elastic.clients.transport") + javadoc("elasticsearch-rest-client-sniffer", version -> "https://artifacts.elastic.co/javadoc/org/elasticsearch/client/elasticsearch-rest-client-sniffer/%s".formatted(version), "org.elasticsearch.client.sniff") } } library("Flyway", "10.10.0") { @@ -479,6 +482,7 @@ bom { } links { site("https://www.h2database.com") + javadoc("https://www.h2database.com/javadoc", "org.h2") releaseNotes("https://github.com/h2database/h2database/releases/tag/version-{version}") } } @@ -503,7 +507,7 @@ bom { } links { site("https://hazelcast.com") - javadoc("https://javadoc.io/doc/com.hazelcast/hazelcast/{version}", "com.hazelcast") + javadoc("https://docs.hazelcast.org/docs/{version}/javadoc/", "com.hazelcast") releaseNotes("https://github.com/hazelcast/hazelcast/releases/tag/v{version}") } } @@ -625,6 +629,7 @@ bom { } links { site("https://infinispan.org/") + javadoc(version -> "https://docs.jboss.org/infinispan/%s.%s/apidocs".formatted(version.major(), version.minor()), "org.infinispan") releaseNotes("https://github.com/infinispan/infinispan/releases/tag/{version}") } } @@ -636,6 +641,7 @@ bom { } links { site("https://github.com/influxdata/influxdb-java") + javadoc("https://javadoc.io/doc/org.influxdb/influxdb-java/{version}", "org.influxdb") releaseNotes("https://github.com/influxdata/influxdb-java/releases/tag/influxdb-java-{version}") } } @@ -823,6 +829,11 @@ bom { "jakarta.ws.rs-api" ] } + links { + releaseNotes("https://github.com/jakartaee/rest/releases/tag/{version}") + javadoc(version -> "https://jakarta.ee/specifications/restful-ws/%s.%s/apidocs" + .formatted(version.major(), version.minor()), "jakarta.ws.rs") + } } library("Jakarta XML Bind", "4.0.2") { group("jakarta.xml.bind") { @@ -871,6 +882,9 @@ bom { "cache-api" ] } + links { + javadoc("https://javadoc.io/doc/javax.cache/cache-api/{version}", "javax.cache") + } } library("Javax Money", "1.1") { group("javax.money") { @@ -1104,6 +1118,7 @@ bom { } links { site("https://kafka.apache.org") + javadoc(version -> "https://kafka.apache.org/%s%s/javadoc".formatted(version.major(), version.minor()), "org.apache.kafka") releaseNotes("https://downloads.apache.org/kafka/{version}/RELEASE_NOTES.html") } } @@ -1152,6 +1167,7 @@ bom { } links { site("https://github.com/lettuce-io/lettuce-core") + javadoc("https://javadoc.io/doc/io.lettuce/lettuce-core/{version}", "io.lettuce.core") docs("https://lettuce.io/core/{version}/reference/index.html") releaseNotes("https://github.com/lettuce-io/lettuce-core/releases/tag/{version}") } @@ -1168,7 +1184,7 @@ bom { } links { site("https://www.liquibase.com") - javadoc("https://javadoc.io/doc/org.liquibase/liquibase-core/{version}") + javadoc("https://javadoc.io/doc/org.liquibase/liquibase-core/{version}", "liquibase.integration", "liquibase.report") releaseNotes("https://github.com/liquibase/liquibase/releases/tag/v{version}") } } @@ -1409,7 +1425,11 @@ bom { } links { site("https://micrometer.io") - javadoc("https://javadoc.io/doc/io.micrometer/micrometer-core/{version}", "io.micrometer.core") + javadoc("micrometer-core", version -> "https://javadoc.io/doc/io.micrometer/micrometer-core/%s".formatted(version), "io.micrometer.core") + javadoc("micrometer-observation", version -> "https://javadoc.io/doc/io.micrometer/micrometer-observation/%s".formatted(version), "io.micrometer.observation") + javadoc("micrometer-registry-graphite", version -> "https://javadoc.io/doc/io.micrometer/micrometer-registry-graphite/%s".formatted(version), "io.micrometer.graphite") + javadoc("micrometer-registry-jmx", version -> "https://javadoc.io/doc/io.micrometer/micrometer-registry-jmx/%s".formatted(version), "io.micrometer.jmx") + javadoc("micrometer-new-relic", version -> "https://javadoc.io/doc/io.micrometer/micrometer-registry-new-relic/%s".formatted(version), "io.micrometer.newrelic") docs(version -> "https://docs.micrometer.io/micrometer/reference/%s.%s" .formatted(version.major(), version.minor())) releaseNotes("https://github.com/micrometer-metrics/micrometer/releases/tag/v{version}") @@ -1454,6 +1474,9 @@ bom { } links { site("https://github.com/mongodb/mongo-java-driver") + // Mongo has split packages so we can't use them + javadoc("mongodb-driver-core", version -> "https://mongodb.github.io/mongo-java-driver/%s.%s/apidocs/mongodb-driver-core".formatted(version.major(), version.minor())) + javadoc("mongodb-driver-sync", version -> "https://mongodb.github.io/mongo-java-driver/%s.%s/apidocs/mongodb-driver-sync".formatted(version.major(), version.minor())) releaseNotes("https://github.com/mongodb/mongo-java-driver/releases/tag/r{version}") } } @@ -1526,6 +1549,7 @@ bom { } links { site("https://github.com/neo4j/neo4j-java-driver") + javadoc("https://javadoc.io/doc/org.neo4j.driver/neo4j-java-driver/{version}", "org.neo4j.driver") releaseNotes("https://github.com/neo4j/neo4j-java-driver/releases/tag/{version}") } } @@ -1558,7 +1582,12 @@ bom { } links { site("https://github.com/open-telemetry/opentelemetry-java") - javadoc("https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-common/{version}") + javadoc("opentelemetry-api", version -> "https://javadoc.io/doc/io.opentelemetry/opentelemetry-api/%s".formatted(version), "io.opentelemetry.api") + javadoc("opentelemetry-context", version -> "https://javadoc.io/doc/io.opentelemetry/opentelemetry-context/%s".formatted(version), "io.opentelemetry.context") + javadoc("opentelemetry-sdk-common", version -> "https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-common/%s".formatted(version), "io.opentelemetry.sdk.common") + javadoc("opentelemetry-sdk-logs", version -> "https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-logs/%s".formatted(version), "io.opentelemetry.sdk.logs") + javadoc("opentelemetry-sdk-metrics", version -> "https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-metrics/%s".formatted(version), "io.opentelemetry.sdk.metrics") + javadoc("opentelemetry-sdk-trace", version -> "https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-trace/%s".formatted(version), "io.opentelemetry.sdk.trace") releaseNotes("https://github.com/open-telemetry/opentelemetry-java/releases/tag/v{version}") } } @@ -1643,6 +1672,9 @@ bom { "pooled-jms" ] } + links { + javadoc("https://javadoc.io/doc/org.messaginghub/pooled-jms/{version}", "org.messaginghub.pooled.jms") + } } library("Postgresql", "42.7.4") { group("org.postgresql") { @@ -1652,6 +1684,7 @@ bom { } links { site("https://github.com/pgjdbc/pgjdbc") + javadoc("https://jdbc.postgresql.org/documentation/publicapi", "org.postgresql") releaseNotes("https://github.com/pgjdbc/pgjdbc/releases/tag/REL{version}") } } @@ -1663,6 +1696,7 @@ bom { } links { site("https://github.com/prometheus/client_java") + javadoc("prometheus-metrics-tracer-common", (version) -> "https://javadoc.io/doc/io.prometheus/prometheus-metrics-tracer-common/%s".formatted(version), "io.prometheus.metrics.tracer.common") releaseNotes("https://github.com/prometheus/client_java/releases/tag/v{version}") } } @@ -1674,6 +1708,7 @@ bom { } links { site("https://github.com/prometheus/client_java") + javadoc("prometheus-simpleclient-tracer-common", (version) -> "https://javadoc.io/doc/io.prometheus/simpleclient_tracer_common/%s".formatted(version), "io.prometheus.client.exemplars.tracer.common") releaseNotes("https://github.com/prometheus/client_java/releases/tag/parent-{version}") } } @@ -1870,6 +1905,9 @@ bom { "rest-assured-bom" ] } + links { + javadoc("https://javadoc.io/doc/io.rest-assured/rest-assured/{version}", "io.restassured") + } } library("RSocket", "1.1.3") { prohibit { @@ -1883,6 +1921,7 @@ bom { } links { site("https://github.com/rsocket/rsocket-java") + javadoc("https://javadoc.io/doc/io.rsocket/rsocket-core/{version}", "io.rsocket") releaseNotes("https://github.com/rsocket/rsocket-java/releases/tag/{version}") } } @@ -2002,6 +2041,7 @@ bom { } links { site("https://www.selenium.dev") + javadoc("https://www.selenium.dev/selenium/docs/api/java", "org.openqa.selenium") releaseNotes("https://github.com/SeleniumHQ/selenium/releases/tag/selenium-{version}") } } @@ -2269,6 +2309,7 @@ bom { } links { site("https://github.com/spring-projects/spring-retry") + javadoc("https://javadoc.io/doc/org.springframework.retry/spring-retry/{version}", "org.springframework.retry") releaseNotes("https://github.com/spring-projects/spring-retry/releases/tag/v{version}") } } @@ -2321,7 +2362,7 @@ bom { site("https://spring.io/projects/spring-ws") github("https://github.com/spring-projects/spring-ws") javadoc(version -> "https://docs.spring.io/spring-ws/docs/%s/api" - .formatted(version.forMajorMinorGeneration()), "org.springframework.ws") + .formatted(version.forMajorMinorGeneration()), "org.springframework.ws", "org.springframework.xml") docs(version -> "https://docs.spring.io/spring-ws/docs/%s/reference/html" .formatted(version.forMajorMinorGeneration())) releaseNotes("https://github.com/spring-projects/spring-ws/releases/tag/v{version}") @@ -2406,7 +2447,7 @@ bom { } links { site("https://tomcat.apache.org") - javadoc(version -> "https://tomcat.apache.org/tomcat-%s.%s-doc/api".formatted(version.major(), version.minor())) + javadoc(version -> "https://tomcat.apache.org/tomcat-%s.%s-doc/api".formatted(version.major(), version.minor()), "org.apache.catalina") docs(version -> "https://tomcat.apache.org/tomcat-%s.%s-doc".formatted(version.major(), version.minor())) releaseNotes(version -> "https://tomcat.apache.org/tomcat-%s.%s-doc/changelog.html".formatted(version.major(), version.minor())) }