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

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> 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
-
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

Back to the top