Tomcat incorporato non lascerà che le mie storie di selenio / jbehave funzioni
-
11-12-2019 - |
Domanda
Sto cercando il Tomcat incorporato per iniziare prima dei test di integrazione (Miniera Usa Selenium + Jbehave) e Stop subito dopo .
Ecco come ho provato a configurare 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>
Tuttavia, Tomcat inizia OK quando eseguo mvn integration-test
e sembra che non lascerà che le mie storie funzionino ...
Qualcuno può aiutare?
Soluzione
Penso di aver trovato la soluzione.Funziona con la seguente configurazione:
<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>
.
AVVISO L'elemento di configurazione aggiunto che indica Tomcat alla forcella .