You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@codehaus.org> on 2014/07/02 21:40:10 UTC

[jira] (MNG-2875) Maven does not honour Plexus component lifecycles in embedded environment for singleton-keep-alive components

     [ https://jira.codehaus.org/browse/MNG-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov updated MNG-2875:
--------------------------------

    Fix Version/s:     (was: Issues to be reviewed for 3.x)
                   3.0

> Maven does not honour Plexus component lifecycles in embedded environment for singleton-keep-alive components
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2875
>                 URL: https://jira.codehaus.org/browse/MNG-2875
>             Project: Maven
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 2.0.5
>            Reporter: Ross Lamont
>             Fix For: 3.0
>
>
> I have a plugin which is injected with a Plexus Component.  This plexus component implements the plexus Startable interface, and therefore expects stop() to be called upon completion in order to perform cleanup.  In addition, the component is a singleton-keep-alive component so it sticks around for a while and is available to other plugins.
> Now this plugin spawns and monitors a thread (it actually kicks off a copy of Jetty 5 so I can do integration tests).  Naturally, I want to shut down Jetty 5 after my tests have run.  To do this I have another plugin which is run after my integration tests which gets the component and tells it to shutdown the threads.
> All works well so far, provided that the tests don't fail.
> If the tests do fail, the stop plugin is never reached.  In standalone maven this all works fine, because the process ends, killing the threads.
> In embedded maven however, the stop method of the component is never called, so that my copy of Jetty keeps on running and I have to shutdown my entire embedded environment (in this case Netbeans with Mevenide, but I believe the same problem occurs in Eclipse).
> Running through the code, it appears that Maven never shuts down the top level component, thus components never have the opportunity to cleanup.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)