[英]Maven failsafe: Start jetty in different directory
我有一個帶有不同模塊的maven項目,其中一個包含我的Web服務容器,另一個包含我的集成測試,看起來像這樣:
-ProjectRoot
--[...]
--WebService
--IntegrationTests
我想使用故障安全插件執行集成測試並在集成測試前的生命周期中啟動碼頭服務器,但是我不知道如何在WebService目錄中啟動碼頭服務器。
我通過mvn clean install
在ProjectRoot目錄中進行測試。
我將其包含在頂級的pom.xml中:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopPort>8005</stopPort>
<stopKey>STOP</stopKey>
<stopWait>10</stopWait>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
Webapp的路徑可以這樣配置:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webAppSourceDirectory>path/to/webapp</webAppSourceDirectory>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.