Created
April 13, 2016 13:23
-
-
Save sdalichampt/afce3d91f3bbf208ae245271cfcab42c to your computer and use it in GitHub Desktop.
Numéro de port aléatoire pour un serveur tomcat embarqué lors de l'éxecution des tests d'intégration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>build-helper-maven-plugin</artifactId> | |
<version>1.10</version> | |
<executions> | |
<execution> | |
<id>reserve-network-port</id> | |
<goals> | |
<goal>reserve-network-port</goal> | |
</goals> | |
<phase>pre-integration-test</phase> | |
<configuration> | |
<portNames> | |
<portName>tomcat.http.port</portName> | |
</portNames> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-failsafe-plugin</artifactId> | |
<version>2.19.1</version> | |
<configuration> | |
<encoding>${project.build.sourceEncoding}</encoding> | |
<includes> | |
<include>**/*ITest.java</include> | |
</includes> | |
<systemPropertyVariables> | |
<tomcat.http.port>${tomcat.http.port}</tomcat.http.port> | |
</systemPropertyVariables> | |
</configuration> | |
<executions> | |
<execution> | |
<goals> | |
<goal>integration-test</goal> | |
<goal>verify</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.getProperty("tomcat.http.port") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.tomcat.maven</groupId> | |
<artifactId>tomcat7-maven-plugin</artifactId> | |
<version>2.2</version> | |
<configuration> | |
<path>/myproject</path> | |
<port>${tomcat.http.port}</port> | |
</configuration> | |
<executions> | |
<execution> | |
<id>start-tomcat</id> | |
<phase>pre-integration-test</phase> | |
<goals> | |
<goal>run</goal> | |
</goals> | |
<configuration> | |
<fork>true</fork> | |
</configuration> | |
</execution> | |
<execution> | |
<id>stop-tomcat</id> | |
<phase>post-integration-test</phase> | |
<goals> | |
<goal>shutdown</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment