title: Gracefully stopping a java process started by maven-antrun-plugin
body: <p>This question is a result of an answer to this question from yesterday</p>
  
  <p><a href="https://stackoverflow.com/questions/35437358/run-a-java-application-and-a-web-application-in-a-single-maven-build-within-a-re/35437896#35437896">run a java application and a web application in a single maven build within a reactor project</a></p>
  
  <p>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 - </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
  &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
  &lt;version&gt;1.8&lt;/version&gt;
  &lt;executions&gt;
  &lt;execution&gt;
    &lt;phase&gt; verify &lt;/phase&gt;
    &lt;configuration&gt;
      &lt;target&gt;
        &lt;property name="runtime_classpath" refid="maven.runtime.classpath" /&gt;
        &lt;exec executable="java" spawn="true"&gt;
          &lt;arg value="-classpath"/&gt;
          &lt;arg value="${runtime_classpath}"/&gt;
          &lt;arg value="somepackage.AppServer"/&gt;
        &lt;/exec&gt;  
      &lt;/target&gt;
    &lt;/configuration&gt;
    &lt;goals&gt;
      &lt;goal&gt;run&lt;/goal&gt;
    &lt;/goals&gt;
  &lt;/execution&gt;
  &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>The above configuration smoothly starts my appserver as a background process. </p>
  
  <p>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. </p>