You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fast mode: failOnError=true cannot fail the build from session-end listener #352
When -Dmaven.clean.fast=true is set, BackgroundCleaner runs deletion inside a Maven session-end listener (AbstractEventSpy.onEvent). Maven catches exceptions thrown from listeners and downgrades them to a warning:
[WARNING] Failed to notify spy EventSpyImpl
This means failOnError=true silently has no effect in fast mode: deletion failures are logged as warnings but the build still succeeds. This is documented in the current Javadoc but is a real user-visible gap.
Root cause
A session-end listener is the wrong execution context to fail a build. Maven's listener dispatch swallows exceptions — there is no mechanism to propagate them as a MojoExecutionException from that point.
Check accumulated errors at next module execution: have CleanMojo.execute() check BackgroundCleaner's accumulated fatal errors at the start of the next module's run and throw MojoExecutionException if any exist. This keeps the asynchrony but introduces a one-module delay before the failure surfaces.
Give up asynchrony when failOnError=true: when failOnError=true, have CleanMojo.execute() wait for that module's deletion to complete synchronously before returning, turning fast mode into a synchronous operation for that configuration. Simpler semantics, but defeats the performance benefit for that config.
Both have real trade-offs. Neither belonged in PR #347.
Activity
fix: MCLEAN-102, session-scoped BackgroundCleaner, batch retry for bo…
fix: honour failOnError in fast mode by running deletion synchronously (
fix: failOnError has no effect in fast mode — staging-area failures d…
fix: clarify that failOnError has no effect in fast mode (fixes apach…
fix: clarify that failOnError has no effect in fast mode (fixes apach…