This document explains how platform-java publishes API documentation to GitHub Pages.
The platform-java project automatically generates and publishes JavaDoc to GitHub Pages at:
https://flossware.github.io/platform-java/
This provides:
- Browsable API documentation for all modules
- Search functionality for classes and methods
- Professional landing page with navigation
- Version information and metadata
- Module index for easy navigation
The workflow (.github/workflows/javadoc.yml) is triggered by:
- Tag pushes - When a release tag is created (e.g.,
1.1,1.2) - Manual dispatch - Via GitHub Actions UI for on-demand generation
Workflow Steps:
- Check out repository code
- Set up JDK 21 and Maven cache
- Generate aggregate JavaDoc with
mvn javadoc:aggregate - Extract version information from POM
- Create enhanced landing page with custom HTML/CSS
- Generate API module index
- Verify JavaDoc generation
- Upload to GitHub Pages artifact
- Deploy to GitHub Pages environment
POM Setup:
- Parent POM (
pom.xml) configures:maven-javadoc-pluginv3.6.3 with aggregate goalmaven-site-pluginv3.12.1 for site generation- JavaDoc options: source=21, doclint=none, HTML5 output
- Search feature enabled for Java 9+ JavaDoc
- Custom tags (apiNote, implSpec, implNote)
- Links to Oracle Java 21 documentation
target/site/apidocs/
├── index.html # Custom landing page
├── index-all.html # Full API index (generated)
├── modules.html # Module navigation page
├── version.txt # Version metadata
├── org/flossware/platform/
│ ├── api/ # API documentation
│ ├── core/ # Core platform docs
│ ├── classloader/ # ClassLoader docs
│ ├── threadpool/ # Thread pool docs
│ ├── security/ # Security docs
│ ├── monitoring/ # Monitoring docs
│ ├── messaging/ # Messaging docs
│ ├── rest/ # REST API docs
│ └── metrics/ # Metrics docs
└── resources/ # Stylesheets and assets
Required Configuration:
- Go to Repository Settings → Pages
- Set Source to:
Deploy from a branch - Select Branch:
gh-pages - Select Folder:
/ (root) - Enforce HTTPS:
✓(recommended)
Domain (Optional):
- Custom domain support available if configured
- Default:
https://github.com/FlossWare/platform-java/pages will be available athttps://flossware.github.io/platform-java/
The workflow automatically:
- Generates JavaDoc artifacts
- Creates/updates the
gh-pagesbranch - Publishes to the configured GitHub Pages URL
- Maintains artifact history (no manual cleanup needed)
Custom HTML5 landing page with:
- Responsive design (mobile-friendly)
- Dark mode support via CSS media queries
- Gradient backgrounds
- Quick access buttons to API docs
- Feature list highlighting key platform capabilities
- Version information loaded dynamically
JavaDoc search is enabled (Java 9+ feature):
- Full-text search of classes, methods, fields
- Quick navigation to API members
- Available in the generated
index-all.html
Dedicated modules.html page with:
- List of all major platform modules
- Direct links to package documentation
- Brief descriptions of each module
- Easy navigation between modules
Generated version.txt includes:
- Release version number
- Generation timestamp (UTC)
- Git reference and commit SHA
- Used to populate dynamic landing page content
Maven JavaDoc plugin configured with:
- HTML5 output - Modern semantic HTML
- Search enabled - Quick class/method lookup
- Custom tags - @apiNote, @implSpec, @implNote
- External links - Links to Java 21 standard library docs
- Encoding - UTF-8 for international characters
- Custom footer - GPL v3 license attribution
View Latest JavaDoc:
https://flossware.github.io/platform-java/
Search for a Class:
- Open the JavaDoc site
- Click "Browse API Documentation"
- Use search box (Java 9+ feature)
Navigate by Module:
- Go to https://flossware.github.io/platform-java/modules.html
- Click module name to view its documentation
Manual Trigger:
# Trigger workflow via GitHub CLI
gh workflow run javadoc.ymlAutomatic Trigger on Release:
# Create and push a release tag
git tag 1.2
git push origin 1.2
# Workflow automatically publishes JavaDocEdit .github/workflows/javadoc.yml in the "Create enhanced landing page" step:
- Update HTML content, styling, and structure
- Modify colors, fonts, and layout
- Add or remove features and links
Edit pom.xml maven-javadoc-plugin configuration:
- Change window title:
<windowtitle> - Modify footer:
<bottom> - Add/remove custom tags
- Adjust search settings:
<searchEnabled>
To add custom CSS:
- Create a stylesheet in a resource directory
- Copy it to the output directory in workflow
- Link it in the custom index.html
✅ Automatic generation on release tags
✅ Professional landing page
✅ JavaDoc search functionality
✅ Module navigation page
✅ Version metadata tracking
✅ GitHub Pages deployment
✅ Dark mode CSS support
✅ Mobile responsive design
-
Versioned Documentation - Separate docs per release version
- Implement version subdirectories (e.g.,
/1.1/,/1.2/) - Create version selector on landing page
- Maintain documentation history
- Implement version subdirectories (e.g.,
-
Advanced Styling
- Custom theme matching project branding
- Syntax highlighting improvements
- Dark mode toggle (not just system preference)
-
Documentation Integration
- Link from README.md to JavaDoc
- Include architectural guides
- Add quickstart examples
-
Search Index
- Full-text search across all documentation
- Elasticsearch integration for advanced search
- Cross-module navigation
Issue: Workflow shows "Generation failed"
Solutions:
- Check Maven compilation succeeds locally:
mvn clean javadoc:aggregate -DskipTests
- Verify all modules are in parent pom.xml
- Check for Javadoc syntax errors in source code
Issue: Changes don't appear on GitHub Pages
Solutions:
- Verify workflow ran successfully (check Actions tab)
- Wait 1-2 minutes for GitHub Pages to rebuild
- Clear browser cache (Ctrl+Shift+R or Cmd+Shift+R)
- Check Repository → Pages → Source is correctly configured
Issue: "Permission denied" when deploying
Solutions:
- Verify workflow has correct permissions:
permissions: contents: read pages: write id-token: write
- Check repository Settings → Actions → General → Workflow Permissions
- Ensure "Read and write permissions" is selected
- Build: See
pom.xmlfor Maven configuration - CI/CD: See
.github/workflows/directory - Platform: See README.md and ARCHITECTURE.md
- Contributing: See CONTRIBUTING.md
JavaDoc documentation is published under the same license as the platform-java source code (GNU GPL v3).
Last Updated: 2024
Maintained By: FlossWare Development Team
Status: Production Ready