【发布时间】:2016-05-28 23:12:31
【问题描述】:
这个问题是昨天对这个问题的回答的结果
run a java application and a web application in a single maven build within a reactor project
所以正如上面问题中的回答,我现在有一个 maven-antrun-plugin,它分叉一个子进程并使用这样的配置运行我的 java appserver -
<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>
以上配置顺利启动我的appserver作为后台进程。
现在我的问题是,在我通过构建启动它之后,是否有一种简单的方法可以找到这个过程并在需要时停止它。
【问题讨论】:
标签: java maven kill-process maven-antrun-plugin