This project applies custom CSS themes to both the Maven-generated documentation site and the JaCoCo coverage reports so they share a consistent visual identity: light backgrounds, GitHub-inspired colors, purple gradient accents, and rounded card-style containers.
src/site/
├── resources/
│ ├── css/
│ │ └── site.css ← Maven site theme (loaded automatically by Fluido)
│ └── images/
│ └── github-copilot.jpg ← Copilot logo for "Powered By" sidebar
├── jacoco-resources/
│ └── report.css ← JaCoCo report theme (overlaid after generation)
└── site.xml ← Fluido skin configuration
.github/
├── templates/
│ ├── index.html ← Version picker page template
│ └── styles.css ← Version picker CSS
└── workflows/
└── deploy-site.yml ← Deploys site + overlays JaCoCo CSS
The Maven Fluido Skin 2.1.0 (configured in src/site/site.xml) automatically loads css/site.css from the site resources directory. No additional configuration is needed — placing the file at src/site/resources/css/site.css is sufficient.
| Element | Style |
|---|---|
| Navbar | Dark (#24292f) with no gradient or border, subtle box shadow |
| Sidebar | White card with rounded corners (border-radius: 10px), 1px border |
| Active nav item | Purple gradient (#667eea → #764ba2) |
| Links | GitHub-blue (#0969da), hover darkens to #0550ae |
| Code blocks | Light gray background (#eef1f6) to distinguish from the white page |
| Inline code | Tinted purple background (rgba(102, 126, 234, 0.1)) |
| Tables | Rounded borders, light header, subtle row hover |
| Sections | White card with border and padding (nested sections are transparent) |
| Alerts | Rounded with 4px left accent border, color-coded (info/warning/danger/success) |
| Typography | System font stack (-apple-system, BlinkMacSystemFont, 'Segoe UI', ...) |
The Fluido skin renders a "Fork me on GitHub" ribbon using a ::after pseudo-element with content: attr(data-ribbon). We override this to say "View on GitHub" with a purple gradient background:
.github-fork-ribbon:before {
background-color: #667eea !important;
background-image: linear-gradient(135deg, #667eea, #764ba2) !important;
}
.github-fork-ribbon:after {
content: 'View on GitHub' !important;
}Note: Both
background-colorandbackground-imagewith!importantare required because Fluido injects an inline<style>tag that sets the ribbon background.
The poweredBy section in Fluido's sidebar doesn't support custom entries via site.xml (the <poweredBy> element isn't supported in Maven Site Descriptor 2.0.0). Instead, the logo is injected via a CSS ::after pseudo-element on the #poweredBy div:
#poweredBy::after {
content: '';
display: block;
width: 240px;
height: 120px;
background-image: url('../images/github-copilot.jpg');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}The logo image is stored at src/site/resources/images/github-copilot.jpg.
JaCoCo generates standalone HTML reports with their own report.css, completely independent of the Maven site theme. The generated reports reference jacoco-resources/report.css via a <link> tag. There is no built-in mechanism to customize this CSS.
The custom CSS is applied by replacing JaCoCo's default report.css after report generation. This happens through two mechanisms:
In pom.xml, a maven-resources-plugin execution runs during the site phase — after JaCoCo has generated its report and default CSS:
<execution>
<id>overlay-jacoco-css</id>
<phase>site</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.reporting.outputDirectory}/jacoco/jacoco-resources</outputDirectory>
<resources>
<resource>
<directory>src/site/jacoco-resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>The deploy workflow (deploy-site.yml) has a catch-all step that overlays the CSS across all version directories in the site. This covers cases where the Maven overlay ran in a different directory structure:
- name: Overlay custom JaCoCo CSS
run: |
cd site
for dir in */jacoco/jacoco-resources; do
if [ -d "$dir" ]; then
cp ../src/site/jacoco-resources/report.css "$dir/report.css"
echo "Overlaid JaCoCo CSS in $dir"
fi
doneThe JaCoCo reporting plugin (used during mvn site) outputs to jacoco/ by default. The build plugin execution (build-coverage-report-from-tests, phase verify) outputs to jacoco-coverage/. Only the reporting plugin path matters for the deployed site, since the deploy workflow runs mvn site, not mvn verify.
The JaCoCo theme mirrors the main site design:
| Element | Style |
|---|---|
| Background | Light gray (#f6f8fa), same as main site |
| Coverage table | White card with rounded corners, sticky header |
| Row hover | Subtle purple tint (rgba(102, 126, 234, 0.04)) |
| Source code | White background with rounded border |
| Coverage highlights | Green (#dafbe1) for covered, red (#ffeef0) for missed, yellow (#fff8c5) for partial |
| Branch hover | Saturated versions of coverage colors |
| Typography | Same system font stack and monospace fonts as main site |
JaCoCo only generates a report when test execution data (.exec file) exists:
- Snapshot builds in CI: The deploy workflow downloads test results from the "Build & Test" workflow and restores the
.execfile before runningmvn site. Reports are generated. - Release tag builds: Tests don't run at tag checkout, so no
.execfile exists and JaCoCo skips report generation. No report to style. - Local builds: Run
mvn clean verify siteto ensure tests run first and the.execfile is available for report generation.
The index.html and styles.css in .github/templates/ power the top-level version picker at the documentation root. These are not part of the Maven site — they are copied directly by the deploy workflow.
The styles use the same design language (purple gradients, rounded cards, GitHub-blue links) but are a standalone CSS file with no dependency on Bootstrap or Fluido.
Edit src/site/resources/css/site.css. Changes take effect on the next mvn site build. Preview locally:
mvn clean site -DskipTests -Dcheckstyle.skip=true
open target/site/index.htmlEdit src/site/jacoco-resources/report.css. Preview locally (requires test data):
mvn clean verify site
open target/site/jacoco/index.htmlEdit .github/templates/index.html and .github/templates/styles.css. These are deployed as-is by the workflow — no build step needed. Preview by opening index.html directly in a browser.