I am starting up my app during the pre-integration-test phase on a dynamic reserved port. I am using the GMaven plugin and Failsafe to issue a REST call to ensure a successful deployment before proceeding with the tests. However the port number is still coming back as null. I set the portNum to the Maven environment variable:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<testPort>${portNum}</testPort>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
But when reading the port in the Groovy script I still get null:
port = System.getProperty("testPort").toString()
uri = "http://localhost:" + port
log.info(uri)
Any ideas are appreciated.
Regards