Browse Source
Reserve dynamic ports for OpenAPI spec generation to avoid port conflicts
pull/15875/head
Viacheslav Klimov
4 weeks ago
Failed to extract signature
1 changed files with
22 additions and
2 deletions
-
application/pom.xml
|
|
|
@ -507,12 +507,31 @@ |
|
|
|
</properties> |
|
|
|
<build> |
|
|
|
<plugins> |
|
|
|
<plugin> |
|
|
|
<groupId>org.codehaus.mojo</groupId> |
|
|
|
<artifactId>build-helper-maven-plugin</artifactId> |
|
|
|
<executions> |
|
|
|
<!-- Reserve free ephemeral ports so concurrent openapi-spec builds (and orphaned |
|
|
|
forks from prior failed builds) on the same CI agent don't collide on fixed ports. --> |
|
|
|
<execution> |
|
|
|
<id>reserve-openapi-ports</id> |
|
|
|
<phase>initialize</phase> |
|
|
|
<goals><goal>reserve-network-port</goal></goals> |
|
|
|
<configuration> |
|
|
|
<portNames> |
|
|
|
<portName>jmx.port</portName> |
|
|
|
<portName>http.port</portName> |
|
|
|
</portNames> |
|
|
|
</configuration> |
|
|
|
</execution> |
|
|
|
</executions> |
|
|
|
</plugin> |
|
|
|
<plugin> |
|
|
|
<groupId>org.springframework.boot</groupId> |
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId> |
|
|
|
<configuration> |
|
|
|
<mainClass>org.thingsboard.server.ThingsboardServerApplication</mainClass> |
|
|
|
<jmxPort>9001</jmxPort> |
|
|
|
<jmxPort>${jmx.port}</jmxPort> |
|
|
|
</configuration> |
|
|
|
<executions> |
|
|
|
<execution> |
|
|
|
@ -532,6 +551,7 @@ |
|
|
|
<arguments> |
|
|
|
<argument>--spring.config.name=thingsboard</argument> |
|
|
|
<argument>--spring.profiles.active=openapi</argument> |
|
|
|
<argument>--server.port=${http.port}</argument> |
|
|
|
</arguments> |
|
|
|
<maxAttempts>180</maxAttempts> |
|
|
|
<wait>2000</wait> |
|
|
|
@ -557,7 +577,7 @@ |
|
|
|
</execution> |
|
|
|
</executions> |
|
|
|
<configuration> |
|
|
|
<apiDocsUrl>http://localhost:8080/v3/api-docs/thingsboard</apiDocsUrl> |
|
|
|
<apiDocsUrl>http://localhost:${http.port}/v3/api-docs/thingsboard</apiDocsUrl> |
|
|
|
<outputFileName>openapi.json</outputFileName> |
|
|
|
<outputDir>${project.build.directory}</outputDir> |
|
|
|
</configuration> |
|
|
|
|