Automatyczne uruchamianie / zatrzymywanie serwera WWW do testów frontendowych
Teraz zaczynam osobno osadzony kocur przez maven:
mvn tomcat7:run
A potem uruchommvn test
cel. Moje pytanie brzmi: czy mogę skonfigurować maven, aby to zrobić automatycznie?tomcat
musi zostać uruchomiony przed uruchomieniem wszystkich testów, a następnie zatrzymany.
Używana jest następująca konfiguracja Maven dla wtyczki tomcat:
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/SpringMvcExample</path>
<url>http://localhost:8080/manager/text</url>
<server>tomcat7</server>
</configuration>
</plugin>
</plugins>
Próbowałem zaktualizować konfigurację wtyczki do:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/SpringMvcExample</path>
<url>http://localhost:8080/manager/text</url>
<server>tomcat7</server>
</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>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
Ale to nie pomogło