1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2025-08-25 20:09:25 +02:00
This commit is contained in:
Dima
2023-06-12 10:41:18 +03:00
parent cc0c3fbf9e
commit 79572e74eb

View File

@@ -0,0 +1,14 @@
package ru.pulsar.jenkins.library.utils;
import com.cloudbees.groovy.cps.NonCPS;
import java.io.IOException;
import java.net.ServerSocket;
public class PortPicker {
@NonCPS
static int port() throws IOException {
int result = new ServerSocket(0).getLocalPort();
return result;
}
}