Class WorkspaceReportException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.maven.api.services.MavenException
org.apache.maven.api.plugin.MojoException
network.ike.plugin.ws.WorkspaceReportException
All Implemented Interfaces:
Serializable

public final class WorkspaceReportException extends org.apache.maven.api.plugin.MojoException
A goal failure that still carries a report to persist (IKE-Network/ike-issues#935).

The default ws:* contract is "a failed goal produces no report": AbstractWorkspaceMojo.runGoal() throws a plain MojoException and the final Mojo.execute() skips the report write. That is correct for a goal that fails before producing anything worth recording.

Some goals, though, do real work and gather real findings before a downstream step fails — ws:scaffold-draft / -publish walk every subproject, accumulate per-subproject results and any newly surfaced sections (e.g. a #417 foundation-upgrade notice), then fail if any subproject failed. Throwing a plain MojoException there left the previous run's ws꞉scaffold-*.md on disk, so a stale report silently masqueraded as the current one, with no staleness marker (#935).

A goal in that situation throws this exception instead. execute() writes the carried report — stamped by WorkspaceReport with the current run's timestamp, and by convention prefixed with a failure banner — before propagating the failure, so the on-disk report always reflects the run that just happened.

See Also:
  • Constructor Details

    • WorkspaceReportException

      public WorkspaceReportException(String message, WorkspaceReportSpec report)
      Fail the goal, but persist report first.
      Parameters:
      message - the failure message Maven surfaces
      report - the report to write before the build fails
  • Method Details

    • report

      public WorkspaceReportSpec report()
      The report Mojo.execute() writes before it re-throws this failure.
      Returns:
      the report to persist