To clarify what is going on:
The behaviour of the Eclipse Console "stop" button is different under Windows and Linux.
The implementation of the "stop" button calls java.lang.Process.destory() to kill the process that was launched in the Console.
On Windows, the implementation of Process.destory() is a brutal kill which does not allow the jvm to run the shutdown hooks.
On Linux, the implementation of Process.destroy does allow for the jvm to run the shutdown hooks.
Furthermore, on Linux, the mvn shell script launches java with an exec, meaning that the running shell script process is replaced
by the jvm execution. Therefore, when Process.destory() is invoked by the "stop" button, the process that will be stopped is that of
the jvm. On Windows however, it seems that there is no exec, and so there is one process for the mvn batch file and another for
the jvm launched from it. Therefore, the Process.destroy() can only affect the mvn batch file process, leaving the jvm process
running. You will need to use the Task Manager to kill the child java process.
+ https://bugs.eclipse.org/bugs/show_bug.cgi?id=38016
+ https://bugs.eclipse.org/bugs/show_bug.cgi?id=55208
+ http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4485742
regards
Jan
I run mvn jetty:run directly as a external tool from eclipse.
Clicking the red stop square works perfectly.
Why do you need a bat file?