Class InjectJavadocThemeMojo
- All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo
Java 25's stock Javadoc stylesheet exposes a :root block of
CSS custom properties — colours, fonts, spacing. This mojo writes a
companion stylesheet resource-files/ike-theme.css that
overrides only those custom properties to the
sentry-green palette used by the project Maven site, then
injects a second <link rel="stylesheet"> tag into every HTML
page so the override cascades over the stock stylesheet.
Same pattern as InjectBreadcrumbMojo for JaCoCo reports:
a single in-source CSS string is the source of truth, written into
the apidocs output after the javadoc tool has produced its files,
and the existing default stylesheet is left untouched (resilient to
Java version updates).
Usage in the IKE release flow:
mvn site # produces target/site/apidocs/ mvn ike:inject-javadoc-theme # writes ike-theme.css and patches HTML mvn site:stage # collects target/site → target/staging
IKE-Network/ike-issues#518.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()static StringGenerate the IKE theme override CSS for Javadoc.protected org.apache.maven.api.plugin.LoggetLog()Access the Maven logger.static StringinjectThemeCssLink(String html) Inject a stylesheet link toresource-files/ike-theme.cssafter the existing link toresource-files/stylesheet.css.
-
Constructor Details
-
InjectJavadocThemeMojo
public InjectJavadocThemeMojo()Creates this goal instance.
-
-
Method Details
-
getLog
protected org.apache.maven.api.plugin.Log getLog()Access the Maven logger.- Returns:
- the logger
-
execute
public void execute() throws org.apache.maven.api.plugin.MojoException- Specified by:
executein interfaceorg.apache.maven.api.plugin.Mojo- Throws:
org.apache.maven.api.plugin.MojoException
-
injectThemeCssLink
Inject a stylesheet link toresource-files/ike-theme.cssafter the existing link toresource-files/stylesheet.css. The injected URL inherits the same relative-path prefix as the stock stylesheet, so it resolves correctly from any page depth.- Parameters:
html- the HTML content- Returns:
- HTML with the theme link injected, or unchanged if no stock stylesheet link is present
-
generateThemeCss
Generate the IKE theme override CSS for Javadoc.Overrides only the
:rootcustom properties exposed by the stock Java 25 stylesheet — the cascade does the rest. Palette constants come fromIkePaletteso this theme,InjectBreadcrumbMojo's, andike-base-parent'ssite.cssall share one source.- Returns:
- CSS content as a string
-