This document describes the API documentation generation system for PatternFly Java, covering the aggregation strategy, build configuration, and publishing workflows. The API documentation is generated using Javadoc and published to a dedicated GitHub Pages repository.
For information about the showcase application and component demonstrations, see Showcase Application Development. For details on the overall release process, see Release Process.
PatternFly Java uses a centralized aggregation approach to generate comprehensive API documentation across all modules. The apidoc module serves as an artificial aggregator that collects sources from multiple modules and produces a unified Javadoc output.
Key Design Decisions:
Published Location: https://patternfly-java.github.io/apidocs/
The apidoc module (apidoc/pom.xml1-164) is a special-purpose packaging module that:
patternfly-java-code-parentSources: apidoc/pom.xml1-164
The documentation build process aggregates Java sources from multiple modules into a single directory structure before generating Javadoc. This ensures all classes appear in a unified package hierarchy with proper cross-references.
Three distinct copy operations execute before Javadoc generation:
Copies the Maven dependency graph image to the documentation assets directory (apidoc/pom.xml66-78):
dependency-graph.png (root directory)src/main/javadoc/doc-files/dependency-graph.pngAggregates all Java source files from production modules (apidoc/pom.xml79-114):
src/main/java/org/patternfly/**/*.java files from:
charts/src/main/java/org/patternfly/components/src/main/java/org/patternfly/core/src/main/java/org/patternfly/extensions/codeeditor/src/main/java/org/patternfly/extensions/finder/src/main/java/org/patternfly/icons/src/main/java/org/patternfly/layouts/src/main/java/org/patternfly/tokens/src/main/java/org/patternfly/Aggregates demonstration code for snippet inclusion (apidoc/pom.xml115-132):
src/demo/java**/*.java files from:
core/src/demo/javacomponents/src/demo/java--snippet-path to enable {@snippet} tags in JavadocSources: apidoc/pom.xml61-134
The Maven Javadoc plugin is configured with several customizations to produce high-quality, well-linked documentation.
| Configuration | Value | Purpose |
|---|---|---|
additionalOptions | --snippet-path=${project.basedir}/src/demo/java | Enable code snippets from demo classes |
debug | true | Verbose output for troubleshooting |
detectLinks | true | Auto-detect external Javadoc links |
doclint | none | Disable strict HTML/reference checking |
docfilessubdirs | true | Process subdirectories in doc-files |
failOnError | false | Continue build on documentation errors |
show | public | Document only public API surface |
Configuration Reference: apidoc/pom.xml138-160
The documentation includes links to external libraries, enabling users to navigate directly to dependency documentation:
Configured Links (apidoc/pom.xml145-155):
Demo classes are excluded from the final documentation to keep the API surface clean (apidoc/pom.xml157-159):
**/*Demo.javaSources: apidoc/pom.xml135-164
The API documentation build follows a specific sequence to ensure all prerequisites are met before Javadoc generation.
BOM Installation (.github/workflows/apidocs.yml25-26)
Project Installation (.github/workflows/apidocs.yml27)
-Dquickly profileDependency Graph Generation (.github/workflows/apidocs.yml28)
dependency-graph.png at project rootdepgraph:aggregate Maven goalSource Aggregation (.github/workflows/apidocs.yml30-32)
Javadoc Generation (.github/workflows/apidocs.yml33)
mvn javadoc:javadoc in apidoc directorytarget/reports/apidocsSources: .github/workflows/apidocs.yml25-34 .github/workflows/release.yml86-95
API documentation is published to GitHub Pages through two workflows: automatic release publishing and manual on-demand publishing.
Triggered by version tags matching v* pattern (.github/workflows/release.yml3-6):
Workflow Details (.github/workflows/release.yml71-104):
publish-apidocsPUBLISH_CONTENT token for cross-repository deploymentpatternfly-java/apidocsgh-pagesTriggered via GitHub Actions UI using workflow_dispatch (.github/workflows/apidocs.yml3-4):
Key Differences from Release Workflow:
| Parameter | Value | Purpose |
|---|---|---|
token | ${{ secrets.PUBLISH_CONTENT }} | GitHub Personal Access Token with cross-repo write access |
repository-name | patternfly-java/apidocs | Target repository for documentation |
branch | gh-pages | Branch hosting GitHub Pages content |
folder | ./apidoc/target/reports/apidocs | Local directory containing generated docs |
clean | true | Remove previous content before deployment |
force | true | Force push even if remote has diverged |
single-commit | true | Squash all changes into one commit |
Authentication Note: The default GITHUB_TOKEN cannot write to external repositories, requiring a custom Personal Access Token stored in PUBLISH_CONTENT secret (.github/workflows/release.yml98 .github/workflows/apidocs.yml37).
Sources: .github/workflows/release.yml71-104 .github/workflows/apidocs.yml1-43
The apidoc module configures Maven Clean plugin to remove both generated source directories and the standard target directory (apidoc/pom.xml49-60):
Cleaned Directories:
src/demo - Copied demonstration codesrc/main/java - Aggregated production sourcesThis ensures each build starts with a clean slate, preventing stale sources from previous builds from affecting the documentation.
Sources: apidoc/pom.xml49-60
https://patternfly-java.github.io/apidocs/
gh-pagesThe published documentation includes:
Documentation is updated:
Sources: .github/workflows/release.yml71-104 .github/workflows/apidocs.yml1-43
Refresh this wiki