Class ScanRendererLogsMojo

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

@Mojo(name="scan-logs", defaultPhase="verify") public class ScanRendererLogsMojo extends Object implements org.apache.maven.api.plugin.Mojo
Scan renderer log files for error patterns and print a summary.

Finds all renderer-*.log files in the configured directory, counts lines matching common error patterns (error, fatal, exception, failed, not found), and prints a one-line summary per renderer.

Never fails the build — renderer exit codes already fail the build if appropriate. This goal is informational only.

Replaces: scan-renderer-logs.sh

Usage:

mvn ike:scan-logs -DlogsDir=target/generated-docs
  • Constructor Details

    • ScanRendererLogsMojo

      public ScanRendererLogsMojo()
      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
    • countErrors

      public static int countErrors(String logContent)
      Count lines containing error patterns in log content.

      Matches case-insensitively against: error, fatal, exception, failed, not found.

      Parameters:
      logContent - the log file content
      Returns:
      number of lines containing at least one error pattern
    • formatSummary

      public static String formatSummary(String rendererName, int lines, int errors)
      Format a one-line summary for a renderer log.
      Parameters:
      rendererName - short renderer name (e.g., "prince", "fop")
      lines - total lines in the log file
      errors - number of error lines
      Returns:
      formatted summary string
    • extractRendererName

      public static String extractRendererName(String filename)
      Extract the renderer name from a log filename.

      Given "renderer-prince.log", returns "prince".

      Parameters:
      filename - the log filename (without path)
      Returns:
      the renderer name