埋め込みTomcatは私のセレン/ JBehave Storiesを実行させない
-
11-12-2019 - |
質問
統合テスト(鉱山を使用するSelenium + JBehave)と停止の前に組み込みTomcatを開始し、。
ここにMavenを設定しようとした方法:
.
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
しかし、Tomcatはmvn integration-test
を実行してから[OK]をクリックして、ストーリーを実行させないようです...
誰もが助けになることができますか?
解決
私は解決策を見つけたと思います。次の設定で動作します。
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
.
Tomcatにフォークに伝える追加構成要素に注意してください。