Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

PortnumberMojo

hwbllmnn edited this page Apr 29, 2013 · 2 revisions

Portnumber Mojo

The portnumber mojo can be used to get an unoccupied port number for use in integration tests. This is desirable if you're often running parallel integration test builds with tomcat.

The mojo runs in the initialization phase, you can use the maven expression ${portnumber} afterwards (eg. to specify the port in the tomcat maven plugin, to filter resources used by test scripts etc.). Sometimes you'll get a portnumber that's one too high, as integration test builds often invoke another maven process. Since 1.20 you can also use the ${previousportnumber} expression in order to get the correct one.

Use it like this:

<plugin>
  <groupId>org.deegree</groupId>
  <artifactId>deegree-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>generate-portnumber</id>
      <goals>
        <goal>generate-portnumber</goal>
      </goals>
    </execution>
  </executions>
</plugin>
Clone this wiki locally