Talking to myself here :-) I found out that if your plugin implements (takes deep breath) org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable <https://codehaus-plexus.github.io/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/personality/plexus/lifecycle/phase/Disposable.html>, then your public void dispose() method will be called, at least by the default plugin management machinery present in Maven with no further customization.
Best, Laird On Tue, Oct 31, 2017 at 3:03 PM Laird Nelson <ljnel...@gmail.com> wrote: > I know vaguely that under the covers Maven uses JSR-330 (@Inject). > > Are mojos treated as singletons, or per-execution objects? > > Is there a preDestroy()-like method that gets invoked when a mojo is > destroyed? *Is* a mojo ever destroyed? > > Thanks, > Best, > Laird > -- > https://about.me/lairdnelson >