You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Laird Nelson <lj...@gmail.com> on 2017/11/02 00:20:59 UTC

Re: Mojo lifecycle?

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 <lj...@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
>