mvn exec:javaは、target /の下のコンパイラ出力から直接アプリを実行します-jarから実行する必要はありません:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>uk.co.pookey.hibernate.App</mainClass>
<systemProperties>
<systemProperty>
<key>derby.stream.error.file</key>
<value>${basedir}/target/derby.log</value>
</systemProperty>
</systemProperties>
</configuration>
</execution>
</executions>
</plugin>
mvn exec:execを使用してjarを実行する場合:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<!-- optional -->
<workingDirectory>/tmp</workingDirectory>
<arguments>
<argument>-jar</argument>
<argument>${basedir}/target/hibernate-derby-memory-${project.version}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
突堤の終了に問題がある場合は、統合テストを実行することをお勧めします(または、最初に突堤を終了せずに突堤のメインスレッドを終了しないか、突堤の停止ポートを使用します)。JVMをバックグラウンドで実行し、テスト後にMavenに再度停止させることができます。これには、統合前テスト、統合テスト、または統合後テストの3つのフェーズがあります。これについて詳しくは、 http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testingをご覧ください。jetty mavenプラグインを使用する場合、pom.xml構成は次のようになります。
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<!-- test start/stop: -->
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy-war</goal>
</goals>
<configuration>
<daemon>true</daemon>
<systemProperties>
<systemProperty>
<name>some.prop</name>
<value>false</value>
</systemProperty>
</systemProperties>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
jetty mavenプラグインをこれらのフェーズにバインドする代わりに、mavenantrunプラグインをバインドして任意のコマンドを実行できます。