Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Maven process does not exit gracefully when terminated by Eclipse

No, I am quite certain m2e developers have no immediate plans to
reimplement eclipse launcher framework or java Process.

I also believe your situation is rather rare if not unique, so most
likely developing alternative Maven launcher configuration is your best
bet to get the process termination bahaviour you need. And, hey, if your
implementation proves to be popular, we can discuss how you can
contribute it to m2e core.

--
Regards,
Igor

On 2013-03-07 6:39 AM, David Geiger wrote:
I agree that this issue is not limited to m2e. It appears to me,
however, that it effects the usability of m2e on Windows quite heavily.
Is this just due to my particular use case, i.e., the
appengine-maven-plugin launching a Jetty process, or how do how other
people deal with this? In my current setup, any Maven process launched
by m2e will never terminate correctly.

According to https://bugs.eclipse.org/bugs/show_bug.cgi?id=38016 it
seems that the general issue is not going to be fixed unless the Java
implementation of the Process.destroy() method on Windows changes. The
current 'kill' behavior might also be intended as it guarantees that
even non-responding applications are terminated. In that case, the m2e
developers might want to provide a dedicated way to terminate Maven
gracefully.

On Wed, Mar 6, 2013 at 6:43 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx
<mailto:igor@xxxxxxxxxxxxxx>> wrote:

    This is not specific to m2e, so I suggest bringing this up to Platform
    developers and see if they can suggest anything.

    --
    Regards,
    Igor


    On 2013-03-06 12:26 PM, David Geiger wrote:

        Hi,

        I use m2e 1.2.0. with Eclipse 4.2.1 on a Windows 8 x64 machine to
        package applications for Google AppEngine and deploy them on the
        local
        development server using the appengine-maven-plugin.

        Whenever I click on the red terminate button in the Eclipse console
        view, the Maven process launched by m2e does not seem to terminate
        correctly. As opposed to launching Maven from the command prompt, it
        neither displays the "BUILD SUCCESS" message, nor does it
        terminate any
        child processes such as the Jetty server launched by
        appengine-maven-plugin. I need to terminate these left-over
        processes
        manually every time I stop a Maven application from within Eclipse.

        Is there another way to terminate Maven applications using m2e?

        The issue seems to be related to the behavior of the terminate
        button in
        Eclipse. Apparently, this button calls java.lang.Process.destroy(),
        which, on Windows, is implemented as a simple kill and does not
        allow
        applications to exit gracefully.

        See:
        - https://bugs.eclipse.org/bugs/__show_bug.cgi?id=38016
        <https://bugs.eclipse.org/bugs/show_bug.cgi?id=38016>
        -
        http://jira.codehaus.org/__browse/JETTY-208?__focusedCommentId=115134&page=__com.atlassian.jira.plugin.__system.issuetabpanels:comment-__tabpanel#comment-115134
        <http://jira.codehaus.org/browse/JETTY-208?focusedCommentId=115134&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-115134>

        If this is a general Eclipse issue, there might be a couple of
        workarounds:
        - There appears to be an interface ITerminate that could be
        implemented
        (see first link, comment 31).
        - Maybe the actual Maven process could be launched by another
        process
        that is regularly checked for termination.
        - An additional Eclipse button could be implemented, which correctly
        terminates the Maven process.

        David



_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top