내장형 Tomcat가 내 셀레늄 / jbehave 이야기가 실행되도록하지 않을 것입니다.
-
11-12-2019 - |
문제
나는 (광산 사용 셀레늄 + JBehave) 및 에 정지를 위해 embedded 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>
.
추가 된 구성 요소 을 포크로 알려줍니다.