|
|
@ -21,6 +21,7 @@ import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.devtools.RemoteSpringApplication;
|
|
|
|
import org.springframework.boot.devtools.RemoteSpringApplication;
|
|
|
|
|
|
|
|
import org.springframework.boot.devtools.tests.JvmLauncher.LaunchedJvm;
|
|
|
|
import org.springframework.util.FileSystemUtils;
|
|
|
|
import org.springframework.util.FileSystemUtils;
|
|
|
|
import org.springframework.util.SocketUtils;
|
|
|
|
import org.springframework.util.SocketUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@ -34,18 +35,19 @@ import org.springframework.util.StringUtils;
|
|
|
|
abstract class RemoteApplicationLauncher implements ApplicationLauncher {
|
|
|
|
abstract class RemoteApplicationLauncher implements ApplicationLauncher {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public LaunchedApplication launchApplication(JavaLauncher javaLauncher)
|
|
|
|
public LaunchedApplication launchApplication(JvmLauncher javaLauncher)
|
|
|
|
throws Exception {
|
|
|
|
throws Exception {
|
|
|
|
int port = SocketUtils.findAvailableTcpPort();
|
|
|
|
int port = SocketUtils.findAvailableTcpPort();
|
|
|
|
Process application = javaLauncher.launch("app", createApplicationClassPath(),
|
|
|
|
LaunchedJvm applicationJvm = javaLauncher.launch("app",
|
|
|
|
"com.example.DevToolsTestApplication", "--server.port=" + port,
|
|
|
|
createApplicationClassPath(), "com.example.DevToolsTestApplication",
|
|
|
|
"--spring.devtools.remote.secret=secret");
|
|
|
|
"--server.port=" + port, "--spring.devtools.remote.secret=secret");
|
|
|
|
Process remoteSpringApplication = javaLauncher.launch("remote-spring-application",
|
|
|
|
LaunchedJvm remoteSpringApplicationJvm = javaLauncher.launch(
|
|
|
|
createRemoteSpringApplicationClassPath(),
|
|
|
|
"remote-spring-application", createRemoteSpringApplicationClassPath(),
|
|
|
|
RemoteSpringApplication.class.getName(),
|
|
|
|
RemoteSpringApplication.class.getName(),
|
|
|
|
"--spring.devtools.remote.secret=secret", "http://localhost:" + port);
|
|
|
|
"--spring.devtools.remote.secret=secret", "http://localhost:" + port);
|
|
|
|
return new LaunchedApplication(new File("target/remote"), application,
|
|
|
|
return new LaunchedApplication(new File("target/remote"),
|
|
|
|
remoteSpringApplication);
|
|
|
|
applicationJvm.getStandardOut(), applicationJvm.getProcess(),
|
|
|
|
|
|
|
|
remoteSpringApplicationJvm.getProcess());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract String createApplicationClassPath() throws Exception;
|
|
|
|
protected abstract String createApplicationClassPath() throws Exception;
|
|
|
|