315748 added --pre support in start.jar

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1929 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2010-06-07 00:02:08 +00:00
parent 3e70a7f7ac
commit cf039140fb
4 changed files with 26 additions and 12 deletions

View File

@ -48,16 +48,19 @@ provided by the start.ini file:
java -jar start.jar --help java -jar start.jar --help
To run with add configuration file(s), eg SSL To run with extra configuration file(s) appended, eg SSL
java -jar start.jar etc/jetty-ssl.xml java -jar start.jar etc/jetty-ssl.xml
To run with extra configuration file(s) prepended, eg logging & jmx
java -jar start.jar --pre=etc/jetty-logging.xml --pre=etc/jetty-jmx.xml
To run without the args from start.ini To run without the args from start.ini
java -jar start.jar --ini OPTIONS=Server,websocket etc/jetty.xml etc/jetty-deploy.xml etc/jetty-ssl.xml java -jar start.jar --ini OPTIONS=Server,websocket etc/jetty.xml etc/jetty-deploy.xml etc/jetty-ssl.xml
To run with JNDI support to list the know OPTIONS:
java -jar start.jar OPTIONS=Server,jsp
java -jar start.jar --list-options

View File

@ -1,12 +1,14 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- ==================================================================== --> <!-- ============================================================================ -->
<!-- To correctly start Jetty with JMX module enabled, this configuration --> <!-- To correctly start Jetty with JMX module enabled, this configuration -->
<!-- file must appear first in the list of the configuration files. --> <!-- file must appear first in the list of the configuration files. -->
<!-- The simplest way to achieve this is to add etc/jetty-jmx.xml as the --> <!-- The simplest way to achieve this is to add etc/jetty-jmx.xml as the -->
<!-- first file in configuration file list at the end of start.ini file. --> <!-- first file in configuration file list at the end of start.ini file. -->
<!-- ==================================================================== --> <!-- Alternately start the server with: -->
<!-- java -Dcom.sun.management.jmxremote -jar start.jar --pre=etc/jetty-jmx.xml -->
<!-- ============================================================================ -->
<Configure id="Server" class="org.eclipse.jetty.server.Server"> <Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- =========================================================== --> <!-- =========================================================== -->

View File

@ -127,9 +127,9 @@ public class Main
List<String> xmls = new ArrayList<String>(); List<String> xmls = new ArrayList<String>();
// Process the arguments // Process the arguments
int startup=0;
for (String arg : arguments) for (String arg : arguments)
{ {
if ("--help".equals(arg) || "-?".equals(arg)) if ("--help".equals(arg) || "-?".equals(arg))
{ {
_showUsage = true; _showUsage = true;
@ -205,6 +205,12 @@ public class Main
_secure = true; _secure = true;
continue; continue;
} }
if (arg.startsWith("--pre="))
{
xmls.add(startup++,arg.substring(6));
continue;
}
if (arg.startsWith("-D")) if (arg.startsWith("-D"))
{ {
@ -258,7 +264,7 @@ public class Main
continue; continue;
} }
// Anything else is considered an XML file. // Anything else is considered an XML file.
xmls.add(arg); xmls.add(arg);
} }

View File

@ -39,6 +39,9 @@ Command Line Options:
start.ini file will be read if it exists. start.ini file will be read if it exists.
A --ini option with no file indicates that A --ini option with no file indicates that
start.ini should not be read. start.ini should not be read.
--pre=<file> Specify a configuration file that is to be processed
before any configuration files listed in start.ini
System Properties: System Properties:
These are set with a command line like "java -Dname=value ..." and are These are set with a command line like "java -Dname=value ..." and are