Skip to content

build(deps): bump com.github.librepdf:openpdf from 2.4.0 to 3.0.2 #136

build(deps): bump com.github.librepdf:openpdf from 2.4.0 to 3.0.2

build(deps): bump com.github.librepdf:openpdf from 2.4.0 to 3.0.2 #136

name: Generate Javadoc
on:
workflow_dispatch:
push:
branches: [master]
paths:
- '**.java'
- 'pom.xml'
- '**/pom.xml'
pull_request:
branches: [master]
paths:
- '**.java'
- 'pom.xml'
- '**/pom.xml'
permissions: read-all
env:
javaVersion: java25
jobs:
javadoc-generation:
name: Generate Javadoc Documentation
runs-on: ubuntu-24.04
timeout-minutes: 60
permissions:
contents: write # Needed for checkout and potential deployment
pages: write # Needed for GitHub Pages deployment
id-token: write # Required for attestation
actions: read # Basic read access to actions
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
allowed-endpoints: >
api.adoptopenjdk.net:443
api.adoptium.net:443
api.github.com:443
archive.apache.org:443
azure.archive.ubuntu.com:80
azure.archive.ubuntu.com:443
security.ubuntu.com:80
security.ubuntu.com:443
github.com:443
maven.java.net:443
maven.vaadin.com:443
objects.githubusercontent.com:443
oss.sonatype.org:443
raw.githubusercontent.com:443
repo.maven.apache.org:443
maven.mirrors.opennms.org:443
repo1.maven.org:443
repository.mulesoft.org:443
tools.google.com:80
tools.vaadin.com:443
uploads.github.com:443
spdx.org:443
sonarcloud.io:443
repository.jboss.org:443
repository.sonatype.org:443
files.pythonhosted.org:443
pypi.org:443
www.bridgecrew.cloud:443
docs.github.com:433
dlcdn.apache.org:443
gwtproject.org:443
java.sun.com:443
jetty.org:443
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 2
- name: Set up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '25'
java-package: 'jdk'
check-latest: true
# Disable built-in cache - we use optimized manual caching below
cache: ''
architecture: 'x64'
# Optimized Maven caching with multiple fallback levels for better resilience
- name: Cache Maven dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: |
~/.m2/repository
~/.m2/wrapper
~/.sonar/cache
# Include Maven version in key for isolation
key: ${{ runner.os }}-maven-3.9.9-${{ hashFiles('**/pom.xml', '.mvn/**') }}
restore-keys: |
${{ runner.os }}-maven-3.9.9-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-3.9.9-
${{ runner.os }}-maven-
- name: Cache APT packages
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/javadoc-generation.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: APT update
run: sudo apt-get update
- name: Install build tools
run: sudo apt-get install -y graphviz
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.9
- name: Build project (skip tests for faster javadoc generation)
run: mvn -B clean install -DskipTests -Prelease-site,all-modules -DfailIfNoTests=false -Dspdx.skip=true -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.pool=true
env:
MAVEN_OPTS: "-Xmx4g -Xms1g --enable-native-access=ALL-UNNAMED"
- name: Generate Javadoc with UML diagrams
run: |
mvn -B javadoc:aggregate -Prelease-site -Dmaven.javadoc.failOnError=false -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.pool=true
env:
MAVEN_OPTS: "-Xmx4g -Xms1g --enable-native-access=ALL-UNNAMED"
- name: Verify Javadoc generation
run: |
echo "Checking generated Javadoc..."
if [ -d "target/reports/apidocs" ]; then
echo "✅ Javadoc generated successfully"
echo "Files generated:"
find target/reports/apidocs -name "*.html" | wc -l
else
echo "⚠️ Javadoc directory not found"
echo "Expected location: target/reports/apidocs"
echo "Directory structure:"
ls -la target/ 2>/dev/null || echo "No target directory"
exit 1
fi
- name: Upload Javadoc artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: javadoc
path: target/reports/apidocs/
retention-days: 30
if-no-files-found: error
- name: Generate Javadoc summary
run: |
echo "## Javadoc Generation Complete ✅" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
HTML_COUNT=$(find target/reports/apidocs -name "*.html" 2>/dev/null | wc -l)
echo "### Generated Documentation" >> $GITHUB_STEP_SUMMARY
echo "- **HTML files**: $HTML_COUNT" >> $GITHUB_STEP_SUMMARY
echo "- **UML diagrams**: Included (via UMLDoclet)" >> $GITHUB_STEP_SUMMARY
echo "- **Cross-referenced source**: Enabled" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Features" >> $GITHUB_STEP_SUMMARY
echo "- Complete API documentation" >> $GITHUB_STEP_SUMMARY
echo "- UML class diagrams for visualization" >> $GITHUB_STEP_SUMMARY
echo "- Dependency source includes" >> $GITHUB_STEP_SUMMARY
echo "- UTF-8 encoding" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Download the artifact to view the Javadoc documentation." >> $GITHUB_STEP_SUMMARY
- name: Comment on PR with Javadoc info
if: github.event_name == 'pull_request'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '## 📚 Javadoc Generated\n\nThe Javadoc documentation has been generated for this PR. Download the `javadoc` artifact from the workflow run to view the complete API documentation with UML diagrams.'
})