私は maven tomcat プラグインを使用して組み込み Tomcat を起動し、それに対して統合テストを実行します。
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>18000</port>
<fork>true</fork>
<webapps>
<webapp>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>${project.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
</configuration>
<executions>
<execution>
<id>tomcat-start</id>
<goals>
<goal>run-war-only</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
すべての作業ファイルですが、アプリケーションのデプロイ中にエラーが発生した場合でも、Maven はビルドの成功を報告するため、混乱を招きます。
SEVERE: Context [/my-web-app] startup failed due to previous errors
15-May-2014 18:08:03 org.apache.catalina.core.ApplicationContext log
その後
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:00.389s
[INFO] Finished at: Thu May 15 18:08:04 CEST 2014
[INFO] Final Memory: 56M/247M
[INFO] ------------------------------------------------------------------------
組み込みの Tomcat デプロイメントが失敗した場合、Maven ビルドが失敗するようにします。
ありがとうございました。