Class InjectSiteStylesMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.guinetik.terminaljavadocs.plugin.InjectSiteStylesMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="inject-styles",
defaultPhase=POST_SITE)
public class InjectSiteStylesMojo
extends org.apache.maven.plugin.AbstractMojo
Injects Terminal Javadocs styling (CSS + JS) into all HTML files
generated by the Maven site.
This Mojo runs after site generation and:
- Copies page-type-specific CSS files to the site directory
- Recursively scans all HTML files in the site directory
- Detects page type (coverage, jxr, javadoc, site)
- Injects the appropriate CSS and JS for each page type
- Supports nested sites (mono-repo style)
The CSS/JS files are built from the css-zen-garden design system using npm and output to this plugin's resources.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPage types with their corresponding CSS files. -
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
InjectSiteStylesMojo
public InjectSiteStylesMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionExecutes the style injection goal.This method:
- Locates the site output directory (staging or site)
- Copies CSS and JS resources to the styles directory
- Replaces JaCoCo's default images with themed versions
- Recursively processes all HTML files, injecting appropriate styles
- Processes nested module sites if enabled
- Throws:
org.apache.maven.plugin.MojoExecutionException- if file operations fail
-