Skip to content

Comments

Add javadoc cross-linking for Fabric8 modules and external dependencies#7445

Open
manusa wants to merge 1 commit intofabric8io:mainfrom
manusa:doc/javadoc-cross-links
Open

Add javadoc cross-linking for Fabric8 modules and external dependencies#7445
manusa wants to merge 1 commit intofabric8io:mainfrom
manusa:doc/javadoc-cross-links

Conversation

@manusa
Copy link
Member

@manusa manusa commented Feb 19, 2026

Summary

Adds <offlineLinks> configuration to the maven-javadoc-plugin in both the release and javadoc-test profiles so that generated javadocs contain clickable hyperlinks to referenced types from other Fabric8 modules and external dependencies via javadoc.io.

All links use offline mode (-linkoffline) with static element-list files checked into doc/javadoc-links/. This avoids any network fetches during javadoc generation, which is critical because:

  • Fabric8 SNAPSHOT versions don't exist on javadoc.io
  • CI runners (GitHub Actions) cannot reliably reach javadoc.io

Cross-linked modules

  • Fabric8 core: kubernetes-model-core, kubernetes-model-common, kubernetes-client-api, kubernetes-client, openshift-client-api, openshift-client
  • External deps: jackson-databind, jackson-core, slf4j-api

Generated link examples

  • KubernetesResourcejavadoc.io/doc/io.fabric8/kubernetes-model-core/...
  • ObjectMapperjavadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/...
  • TypeReferencejavadoc.io/doc/com.fasterxml.jackson.core/jackson-core/...
  • JDK types → docs.oracle.com/en/java/javase/11/docs/api/... (unchanged, via detectJavaApiLink)

Files changed

  • pom.xml<offlineLinks> and <detectOfflineLinks>false</detectOfflineLinks> in both profiles, plus <javadoc.links> property and user-agent header
  • doc/javadoc-links/*/element-list — Static package lists for each linked artifact (9 files)
  • Makefilemake generate-javadoc-links target to regenerate element-list files from source directories
  • CLAUDE.md — Documents the new make target
  • CHANGELOG.md — Entry under Improvements

Notes

  • jackson-annotations is excluded because its Maven artifact version (2.20) differs from ${jackson.version} (2.20.0)
  • Only element-list files are used (not package-list) — having both in the same directory causes JDK 11's javadoc tool to silently fail link resolution
  • failOnError is left at the default (true) so real javadoc errors still break the build
  • When external dependency versions are bumped, regenerate their element-list files by extracting from the new javadoc JARs

Fixes #1105

Test plan

  • Build javadoc for kubernetes-client-api with -Pjavadoc-test — build succeeds with no network errors
  • Verify Fabric8 cross-module links (KubernetesResource, UnmatchedFieldTypeModule) resolve to javadoc.io
  • Verify Jackson links (ObjectMapper, TypeReference) resolve to javadoc.io
  • Verify JDK links (Object, String, InputStream) still resolve to docs.oracle.com
  • CI pipeline passes (no Error fetching URL failures)

🤖 Generated with Claude Code

@manusa manusa force-pushed the doc/javadoc-cross-links branch 3 times, most recently from 2ba144e to aecaed5 Compare February 19, 2026 09:01
@manusa manusa marked this pull request as draft February 19, 2026 09:12
@manusa manusa force-pushed the doc/javadoc-cross-links branch from aecaed5 to e91ef8f Compare February 19, 2026 09:59
Adds <offlineLinks> and <links> configuration to the maven-javadoc-plugin
in both the release and javadoc-test profiles so that generated javadocs
contain clickable hyperlinks to referenced types from other Fabric8
modules and external dependencies (Jackson, SLF4J) via javadoc.io.

Fabric8 cross-module links use offlineLinks with static element-list
files (in doc/javadoc-links/) to avoid network fetches for unpublished
SNAPSHOT versions. External dependency links use regular links.

A `make generate-javadoc-links` target is provided to regenerate the
element-list files from source directories when packages change.

Fixes fabric8io#1105

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@manusa manusa force-pushed the doc/javadoc-cross-links branch from e91ef8f to afd8c74 Compare February 19, 2026 12:07
@manusa manusa marked this pull request as ready for review February 19, 2026 14:57
@manusa
Copy link
Member Author

manusa commented Feb 19, 2026

@ash-thakur-rh I'm not sure if this is something we want to add or not.

It adds more complexity to the build but it also improves the help discoverability. These days this is tantamount since many are starting to rely on coding agents which require context discovery.

I'll leave this here waiting for feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nit: pom.xml should have <links> property

1 participant