wisdom-framework / wisdom

A modular and dynamic web framework
http://wisdom-framework.org
Apache License 2.0
88 stars 42 forks source link

Allow wisdom-maven-plugin to properly terminate background wisdom when maven ends #567

Open Riduidel opened 7 years ago

Riduidel commented 7 years ago

on Windows, when maven build launching wisdom terminates, the chameleon.sh continues its execution, which is quite a pain, since it locks the port used by Wisdom and prevents any re-execution.

Could it possible, in such a case, to register a JVM shutdown hook that will, when invoked, terminate the chameleon run ?

It seems to me that launching is done in WisdomExecutor#executeInBackground(...). More precisely, the line

        Runtime.getRuntime().exec(cmdLine.toStrings(), null, mojo.getWisdomRootDirectory()); //NOSONAR see comment

creates a process, but never connects to it, which prevents its proper termination.

As a side note, i know that this works on MacOS/Linux, but not everybody wants to use these platforms :-)