2

I'm starting a server with exec-maven-plugin like this:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <id>start-server</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <executable>java</executable>
                <arguments>
                    <argument>-classpath</argument>
                    <!-- automatically creates the classpath using all project dependencies, 
                        also adding the project build directory -->
                    <classpath />
                    <argument>MyGroup.MyServer.MyServerpjki</argument>
                    <argument>-batch</argument>
                    <argument>-port</argument>
                    <argument>1025</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

Problem is after execution of the server-process it stops there. It seems like the process is blocking the others, though it says "exec:exec execute programs and Java programs in a separate process" on the exec-maven-plugin page.

Is there anything I can do? I saw Process spawned by exec-maven-plugin blocks the maven process and Maven and Exec: forking a process? . Is there a platform independent solution to this problem?

I also have an additional question: What's the best way to close an application startet by exec-maven-plugin again?

Community
  • 1
  • 1
user2368505
  • 416
  • 3
  • 16

0 Answers0