run java server from maven -
i need run server(implemented in java class) maven if use exec:java goal, block maven , not pass next phases connect server.
is there way run exec:java task asynchronously, without interrupting maven execution?
thanks!
you use exec-maven-plugin run shell script start process , detach (letting process run in background). this:
<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>exec-maven-plugin</artifactid> <executions> <execution> <id>start-server</id> <phase>pre-integration-test</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>src/test/scripts/run.sh</executable> <arguments> <argument>{server.home}/bin/server</argument> </arguments> </configuration> </execution> </executions> </plugin> where run.sh (for u*nix platform):
#! /bin/sh $* > /dev/null 2>&1 & exit 0 that should trick.
Comments
Post a Comment