Pregunta

Estoy tratando de que el Tomcat incrustado empiece a comenzar antes de las pruebas de integración (uso de la mina Selenium + JBEHave) y STOP justo después ".

Aquí es cómo intenté configurar 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>

Sin embargo, Tomcat comienza bien cuando ejecuto mvn integration-test y parece que no dejará que mis historias funcionen ...

¿Puede alguien ayudar?

¿Fue útil?

Solución

creo que encontré la solución.Funciona con la siguiente configuración:

<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>

Observe el elemento de configuración agregado que le dice a Tomcat a Fork .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top