Class WorkspaceReport

java.lang.Object
network.ike.plugin.ws.WorkspaceReport

public final class WorkspaceReport extends Object
Per-goal report writer for ws:* goals.

Each goal writes its own file directly at the workspace root (alongside workspace.yaml and the aggregator 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 ws꞉goal-name.md in IDE file browsers. For draft/publish goals, the filename includes the variant: ws꞉feature-start-draft.md, ws꞉feature-start-publish.md.

Self-healing gitignore: before writing, this class ensures ws꞉*.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 workspace becomes report-ready the first time a ws:* goal runs.

Parallels network.ike.plugin.IkeReport in the ike plugin; both writers now target their respective project roots.

  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    openInBrowser(Path workspaceRoot, org.apache.maven.api.plugin.Log log)
    Open the workspace root in the default file manager or IDE so the user can browse the ws꞉*.md reports alongside workspace.yaml and the aggregator pom.xml.
    static Path
    reportPath(Path workspaceRoot, String goalName)
    Resolve the report file path for a specific goal.
    static void
    write(Path workspaceRoot, String goalName, String content, org.apache.maven.api.plugin.Log log)
    Write a goal's report to its per-goal file at the workspace root, overwriting any previous content.

    Methods inherited from class Object

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

    • write

      public static void write(Path workspaceRoot, String goalName, String content, org.apache.maven.api.plugin.Log log)
      Write a goal's report to its per-goal file at the workspace root, overwriting any previous content. Self-heals the nearest .gitignore so the report does not land in git.
      Parameters:
      workspaceRoot - the workspace root directory
      goalName - the goal name including variant (e.g., "ws:feature-start-draft")
      content - the markdown content to write
      log - Maven logger (warnings only; null-safe)
    • reportPath

      public static Path reportPath(Path workspaceRoot, String goalName)
      Resolve the report file path for a specific goal.
      Parameters:
      workspaceRoot - the workspace root directory
      goalName - the goal name (e.g., "ws:overview")
      Returns:
      path to the report file at the workspace root (may not exist yet)
    • openInBrowser

      public static boolean openInBrowser(Path workspaceRoot, org.apache.maven.api.plugin.Log log)
      Open the workspace root in the default file manager or IDE so the user can browse the ws꞉*.md reports alongside workspace.yaml and the aggregator pom.xml.
      Parameters:
      workspaceRoot - the workspace root directory
      log - Maven logger
      Returns:
      true if opened successfully