Class InjectBreadcrumbMojo

java.lang.Object
network.ike.docs.plugin.InjectBreadcrumbMojo
All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo

@Mojo(name="inject-breadcrumb", defaultPhase="verify") public class InjectBreadcrumbMojo extends Object implements org.apache.maven.api.plugin.Mojo
Inject navigation breadcrumbs and theme overrides into JaCoCo HTML reports.

Finds all HTML files in the target directory and:

  • Prepends a "back to project site" link in the breadcrumb div
  • Injects a CSS link to ike-theme.css for visual alignment with the project's Maven site skin
  • Writes ike-theme.css into the JaCoCo resources directory

Usage:

mvn ike:inject-breadcrumb -DtargetDir=target/site/jacoco
  • Constructor Details

    • InjectBreadcrumbMojo

      public InjectBreadcrumbMojo()
      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:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException
    • injectBreadcrumb

      public static String injectBreadcrumb(String html, String link, String label)
      Inject a breadcrumb navigation link into JaCoCo's breadcrumb div.
      Parameters:
      html - the HTML content
      link - relative URL for the breadcrumb link
      label - display label for the link
      Returns:
      HTML with the breadcrumb injected, or unchanged if the breadcrumb div is not present
    • injectThemeCssLink

      public static String injectThemeCssLink(String html)
      Inject a CSS link to the IKE theme override after the existing report.css link.
      Parameters:
      html - the HTML content
      Returns:
      HTML with the theme CSS link injected
    • generateThemeCss

      public static String generateThemeCss()
      Generate the IKE theme override CSS for JaCoCo reports.

      Overrides JaCoCo's default styling to approximate the Sentry Maven Skin purple theme: dark header bar, consistent font stack, purple accent colors, and improved table readability.

      Returns:
      CSS content as a string