Class WorkspaceReportException
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
Fields inherited from class org.apache.maven.api.plugin.MojoException
longMessage, source -
Constructor Summary
ConstructorsConstructorDescriptionWorkspaceReportException(String message, WorkspaceReportSpec report) Fail the goal, but persistreportfirst. -
Method Summary
Modifier and TypeMethodDescriptionreport()The reportMojo.execute()writes before it re-throws this failure.Methods inherited from class org.apache.maven.api.plugin.MojoException
getLongMessage, getSourceMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
WorkspaceReportException
Fail the goal, but persistreportfirst.- Parameters:
message- the failure message Maven surfacesreport- the report to write before the build fails
-
-
Method Details
-
report
The reportMojo.execute()writes before it re-throws this failure.- Returns:
- the report to persist
-