How to cleanly stop a m2e load: running away from Eclipse?

Using run mojo from the load-maven2 plugin, I would like to know how best to close the container.

The console exit says Ctrl + C to stop, but it does nothing.

If I finish, it will leave the orphan java.exe process that I have to kill.

Am I doing something wrong? This is a little cumbersome.

Edit: I am using Tomcat in a standalone configuration. If I use the built-in Jetty, naturally stop working, however we need Tomcat.

+6
source share
2 answers

The CTRL + C object seems to be known java {, w} .exe does not remain.

I don’t know how you release mvn cargo:run from Eclipse right now, but maybe you are using it as an external tool (and why the process is behind). If you have m2eclipse installed, you must create a Maven launch configuration for it as follows:

 Run --> Run Configurations --> Maven build --> right click --> New 

It should be right here.

(I found two Eclipse error bits ( here and here ), which seems to be related to Eclipse's inability to read healthy CTRL + C through the console.) Sub>


I checked that when I start an external Tomcat instance (7.0.23) with mvn cargo:run from Eclipse via the m2e plugin (after starting the container) CTRL + C the work really does not work.

After that I launched mvn cargo:run from my Cygwin console. The result was the same.

Finally, I tried it from Windows cmd and worked.

I assume this is a bug in cargo-maven-plugin .

Running mvn cargo:stop from Eclipse or Cygwin helped.

You can run the plugin to download from Eclipse by creating a Maven build Run or Debug configuration in Eclipse.

+5
source

In general, if you start Cargo by running Eclipse Maven in DEBUG mode (for example, Debug as → Maven build ...), then killing the process on the Eclipse console (red button) leaves no orphan process ...

I don’t know why, but it works :) At least on my workspace

0
source

Source: https://habr.com/ru/post/899149/


All Articles