嵌入式Tomcat不会让我的Selenium / Jbehave故事运行
-
11-12-2019 - |
题
我正在尝试为嵌入式tomcat开始在集成测试之前启动(矿山使用selenium + jbehave)和停止后,之后。
这是我如何尝试配置maven:
.
但是,当我运行生成的时候,tomcat开始确定,似乎它不会让我的故事运行...
<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>
任何人都可以帮助吗?
解决方案
我想我找到了解决方案。它配合以下配置:
<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到fork 。