package bootstrap;
import java.lang.reflect.Field;
import java.net.InetAddress;
public class BootstrapServer {
public static void main(String[] args) throws Exception {
// --- Read forced hostname from JVM property ---
String forcedHost = System.getProperty("forced.hostname", "default-hostname");
// --- Overwrite InetAddress defaultLocalHost cache ---
Field cached = InetAddress.class.getDeclaredField("defaultLocalHost");
cached.setAccessible(true);
cached.set(null, InetAddress.getByName(forcedHost));
// --- Delegate to the real external main class ---
com.citigroup.get.quantum.server.Server.main(args);
}
}
===============
task runQuantum(type: JavaExec, dependsOn: compileJava) {
group = 'instances'
description = 'Run Quantum Server with forced hostname and tmpdir'
mainClass = 'bootstrap.BootstrapServer'
classpath = sourceSets.main.runtimeClasspath + files('libs/external-jars')
// --- JVM args ---
jvmArgs(
"-Dforced.hostname=egtpsga56.nam.nsroot.net", // hostname override
"-Ddds.tmpdir=${buildDir}/dds_tmp" // tmp dir override
)
doFirst {
println "=== PRE-START INFO ==="
println "JVM args: ${jvmArgs}"
println "Working dir: ${workingDir}"
println "======================"
}
// Pass any regular program args if needed
args "file://src/main/config/quantum/$asset/$region/$env", instanceName, "dummy"
standardInput = System.in
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)