Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
优雅地停止maven exec插件启动的java程序_Java_Maven_Maven Plugin_Maven Exec Plugin - Fatal编程技术网

优雅地停止maven exec插件启动的java程序

优雅地停止maven exec插件启动的java程序,java,maven,maven-plugin,maven-exec-plugin,Java,Maven,Maven Plugin,Maven Exec Plugin,这与问题是一致的: 除了这与maven exec插件有关 我尝试了上面问题中提到的soultion,它使“maven进程插件”更具吸引力。 但是这个插件不支持提供类路径 我的pom.xml看起来像: <project> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId>

这与问题是一致的:

除了这与maven exec插件有关 我尝试了上面问题中提到的soultion,它使“maven进程插件”更具吸引力。 但是这个插件不支持提供类路径

我的pom.xml看起来像:

<project>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <execution>
                    <id>start the server for integration tests</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <classpathScope>test</classpathScope>
                        <async>true</async>
                        <asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
                        <executable>java</executable>
                        <arguments>
                            <argument>-classpath</argument>
                            <classpath/>
                            <argument>com.abc.def.integration.Main</argument>
                        </arguments>
                    </configuration>
                </execution>
                <execution>
                    <phase>post-integration-test</phase>
                    <goals/>
                </execution>
            </plugin>
        </plugins>
    </build>
</project>

org.codehaus.mojo


有办法吗?

如果要启动任何非守护进程线程,则需要在测试的执行后阶段停止它们。