开发者

How to get port number from jetty-maven-plugin?

jetty-maven-plugin 7.x, when used in integration 开发者_JS百科testing, dynamically finds available port, in runtime. How can I save the number of the port found and use it in Java integration tests? Maybe jetty-maven-plugin can save it into a system variable?


This is how it works:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.6</version>
            <configuration>
                <portNames>
                    <portName>jetty.port</portName>
                    <portName>jetty.port.stop</portName>
                </portNames>
            </configuration>
            <executions>
                <execution>
                    <id>reserve-port</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>reserve-network-port</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

Then ${jetty.port} can be used for jetty plugin.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜