Mojo lifecycle?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Mojo lifecycle?

ljnelson
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
Reply | Threaded
Open this post in threaded view
|

Re: Mojo lifecycle?

ljnelson
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 <[hidden email]> 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
>