This question is a result of an answer to this question from yesterday
run a java application and a web application in a single maven build within a reactor project
So as answered in the above question I now have a maven-antrun-plugin that forks a child process and runs my java appserver using a configuration like this -
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase> verify </phase>
<configuration>
<target>
<property name="runtime_classpath" refid="maven.runtime.classpath" />
<exec executable="java" spawn="true">
<arg value="-classpath"/>
<arg value="${runtime_classpath}"/>
<arg value="somepackage.AppServer"/>
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
The above configuration smoothly starts my appserver as a background process.
Now my question is if there is an easy way I can locate this process and stop it if I need after I start it through my build.