Class GoalReport

java.lang.Object
network.ike.plugin.support.GoalReport

public final class GoalReport extends Object
Per-goal report writer for IKE plugins.

Each goal writes its own file directly in the Maven project root the goal was executed from (alongside the invoking pom.xml). Files are overwritten on each run (not appended), so the content always reflects the latest execution.

Filenames use (U+A789 MODIFIER LETTER COLON) to cluster visually as <prefix>꞉goal-name.md in IDE file browsers. For draft/publish goals, the filename includes the variant: ike꞉release-draft.md, ike꞉release-publish.md, idoc꞉asciidoc.md.

Self-healing gitignore: before writing, this class ensures <prefix>꞉*.md is listed in the .gitignore of the nearest .git ancestor. If the pattern is missing, it is appended. This keeps reports out of git without any manual setup — a fresh clone of a consumer repo becomes report-ready the first time an IKE goal runs. One entry is added per plugin prefix seen.

Parallels network.ike.plugin.ws.WorkspaceReport in the ws plugin; both writers target their respective roots (the workspace root for ws, the project root for ike/idoc) and both self-heal the nearest .gitignore.

Replaces the previous network.ike.plugin.IkeReport as part of the plugin split (ike-issues #215).

  • Method Details

    • write

      public static void write(Path projectRoot, GoalRef goal, String content, org.apache.maven.api.plugin.Log log)
      Write a goal's report to its per-goal file at the project root, overwriting any previous content. Self-heals the nearest .gitignore if needed so the report does not land in git.
      Parameters:
      projectRoot - the Maven project root the goal executed from
      goal - the goal whose output is being reported
      content - markdown content to write
      log - Maven logger (null-safe)
    • reportPath

      public static Path reportPath(Path projectRoot, GoalRef goal)
      Resolve the report file path for a specific goal.
      Parameters:
      projectRoot - the Maven project root
      goal - the goal whose report is being located
      Returns:
      path to the report file (may not exist yet)