procctrl
can be used to start a process, and later stop it,
by referencing it symbolically instead of by process id. Additionally, a
"parent" process can be monitored and the spawned process killed when that
parent terminates.
When running on Linux it is straightforward to build procctrl
as a project pre-requisite and rely on it being on the system path. Windows
environments are not capable of building the executable if they do not have
Microsoft Visual Studio installed and so retrieving the binaries from Maven can
be the simplest approach.
The compiled artifacts from all of the BeerDragon projects can be found in the Maven repository hosted on this site. By adding appropriate settings to your Maven settings file you can download the artifacts from this repository to the cache used by your build system.
The following fragment, added to a pom.xml
, will retrieve
the executable and make it available at ${project.build.directory}/dependency/bin-i386
for the 32-bit form and ${project.build.directory}/dependency/bin-x64
for the 64-bit form.
<project><!-- ... --></project>
<build><!-- ... --></build>
<dependencies><!-- ... --></dependencies>
<dependency><groupId>uk.co.beerdragon</groupId></dependency>
<artifactId>procctrl-win32</artifactId>
<version>0.1.1</version>
<type>native-exec</type>
Copyright (c) 2015, all rights reserved.