add a configuration field to MavenServerConnector to be able to force reUsePort (#7963)

Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
This commit is contained in:
Olivier Lamy 2022-08-01 14:42:10 +10:00 committed by GitHub
parent 32e797da2a
commit 875d0b0a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -129,6 +129,11 @@
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<mavenServerConnector>
<reusePort>true</reusePort>
</mavenServerConnector>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -51,6 +51,8 @@ public class MavenServerConnector extends ContainerLifeCycle implements Connecto
private int port;
private long idleTimeout;
private boolean reusePort;
public MavenServerConnector()
{
}
@ -102,6 +104,7 @@ public class MavenServerConnector extends ContainerLifeCycle implements Connecto
this.delegate.setPort(this.port);
this.delegate.setHost(this.host);
this.delegate.setIdleTimeout(idleTimeout);
this.delegate.setReusePort(this.reusePort);
this.delegate.start();
super.doStart();