414635 Modular start.d and jetty.base property
+ Minor formatting and presentation cleanup of --list-config
This commit is contained in:
parent
1844b4bd3d
commit
c70a6fdfe2
|
@ -265,23 +265,21 @@ public class Main
|
|||
// Dump Jetty Home / Base
|
||||
args.dumpEnvironment();
|
||||
|
||||
// Dump Classpath
|
||||
dumpClasspathWithVersions(args.getClasspath());
|
||||
|
||||
// Dump Enabled Modules
|
||||
// Dump JVM Properties
|
||||
System.out.println();
|
||||
System.out.println("Jetty Active Module Tree:");
|
||||
System.out.println("-------------------------");
|
||||
Modules modules = args.getAllModules();
|
||||
modules.dumpEnabledTree();
|
||||
|
||||
// Dump Resolved XMLs
|
||||
System.out.println();
|
||||
System.out.println("Jetty Active XMLs:");
|
||||
System.out.println("------------------");
|
||||
for (File xml : args.getXmlFiles())
|
||||
System.out.println("JVM Arguments:");
|
||||
System.out.println("--------------");
|
||||
for (String jvmArgKey : args.getJvmArgs())
|
||||
{
|
||||
System.out.printf(" - %s%n",baseHome.toShortForm(xml.getAbsolutePath()));
|
||||
String value = System.getProperty(jvmArgKey);
|
||||
if (value != null)
|
||||
{
|
||||
System.out.printf(" %s = %s%n",jvmArgKey,value);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.printf(" %s%n",jvmArgKey);
|
||||
}
|
||||
}
|
||||
|
||||
// Dump Properties
|
||||
|
@ -297,11 +295,33 @@ public class Main
|
|||
String value = props.getProperty(name);
|
||||
System.out.printf(" %s = %s%n",name,value);
|
||||
}
|
||||
|
||||
// Dump Classpath
|
||||
dumpClasspathWithVersions(args.getClasspath());
|
||||
|
||||
// Dump Resolved XMLs
|
||||
System.out.println();
|
||||
System.out.println("Jetty Active XMLs:");
|
||||
System.out.println("------------------");
|
||||
for (File xml : args.getXmlFiles())
|
||||
{
|
||||
System.out.printf(" %s%n",baseHome.toShortForm(xml.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
|
||||
private void listModules(StartArgs args)
|
||||
{
|
||||
System.out.println();
|
||||
System.out.println("Jetty All Available Modules:");
|
||||
System.out.println("----------------------------");
|
||||
args.getAllModules().dump();
|
||||
|
||||
// Dump Enabled Modules
|
||||
System.out.println();
|
||||
System.out.println("Jetty Active Module Tree:");
|
||||
System.out.println("-------------------------");
|
||||
Modules modules = args.getAllModules();
|
||||
modules.dumpEnabledTree();
|
||||
}
|
||||
|
||||
public StartArgs processCommandLine(String[] cmdLine) throws Exception
|
||||
|
|
|
@ -112,14 +112,6 @@ public class StartArgs
|
|||
|
||||
public void dumpEnvironment()
|
||||
{
|
||||
System.out.println();
|
||||
System.out.println("Jetty Environment:");
|
||||
System.out.println("-----------------");
|
||||
|
||||
dumpSystemProperty("jetty.home");
|
||||
dumpSystemProperty("jetty.base");
|
||||
dumpSystemProperty("jetty.version");
|
||||
|
||||
// Java Details
|
||||
System.out.println();
|
||||
System.out.println("Java Environment:");
|
||||
|
@ -131,14 +123,22 @@ public class StartArgs
|
|||
dumpSystemProperty("java.vm.info");
|
||||
dumpSystemProperty("java.runtime.name");
|
||||
dumpSystemProperty("java.runtime.version");
|
||||
|
||||
dumpSystemProperty("java.io.tmpdir");
|
||||
System.out.printf("java.class.path=%s%n",classpath.toString());
|
||||
|
||||
// Jetty Environment
|
||||
System.out.println();
|
||||
System.out.println("Jetty Environment:");
|
||||
System.out.println("-----------------");
|
||||
|
||||
dumpSystemProperty("jetty.home");
|
||||
dumpSystemProperty("jetty.base");
|
||||
dumpSystemProperty("jetty.version");
|
||||
|
||||
}
|
||||
|
||||
private void dumpSystemProperty(String key)
|
||||
{
|
||||
System.out.printf("%s=%s%n",key,System.getProperty(key));
|
||||
System.out.printf(" %s=%s%n",key,System.getProperty(key));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -265,6 +265,11 @@ public class StartArgs
|
|||
return this.enabledModules;
|
||||
}
|
||||
|
||||
public List<String> getJvmArgs()
|
||||
{
|
||||
return jvmArgs;
|
||||
}
|
||||
|
||||
public CommandLineBuilder getMainArgs(BaseHome baseHome, boolean addJavaInit) throws IOException
|
||||
{
|
||||
CommandLineBuilder cmd = new CommandLineBuilder();
|
||||
|
|
|
@ -56,6 +56,8 @@ public class MainTest
|
|||
List<String> cmdLineArgs = new ArrayList<>();
|
||||
addUseCasesHome(cmdLineArgs);
|
||||
cmdLineArgs.add("jetty.port=9090");
|
||||
cmdLineArgs.add("-Xms1024m");
|
||||
cmdLineArgs.add("-Xmx1024m");
|
||||
cmdLineArgs.add("--list-config");
|
||||
|
||||
Main main = new Main();
|
||||
|
|
Loading…
Reference in New Issue