Question

J'essaie du tomcat embarqué de démarrer avant les tests d'intégration (usage de mine SELENIUM + JBeHave) et Arrêtez-vous juste après . .

Voici comment j'ai essayé de configurer 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>

Cependant, Tomcat commence ok lorsque je gère mvn integration-test et il semble que cela ne laisse pas mes histoires courir ...

Quelqu'un peut-il aider?

Était-ce utile?

La solution

Je pense que j'ai trouvé la solution.Il fonctionne avec la configuration suivante:

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

Notez l'élément de configuration supplémentaire qui indique à Tomcat à la fourchette .

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top