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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    Page types with their corresponding CSS files.
  • Field Summary

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the style injection goal.

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InjectSiteStylesMojo

      public InjectSiteStylesMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Executes the style injection goal.

      This method:

      1. Locates the site output directory (staging or site)
      2. Copies CSS and JS resources to the styles directory
      3. Replaces JaCoCo's default images with themed versions
      4. Recursively processes all HTML files, injecting appropriate styles
      5. Processes nested module sites if enabled
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if file operations fail