Launcher class for stand-alone execution of Hudson as
java -jar hudson.war.
- Author(s):
- Kohsuke Kawaguchi
for (int i = 0; i < args.length; i++)
Reads
WEB-INF/classes/dependencies.txt and builds "groupId:artifactId" -> "version" map.
if (tokens.length!=5) continue;
r.put(tokens[0]+":"+tokens[1],tokens[3]);
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) { usage.set(null,"Hudson Continuous Integration Engine "+getVersion("")+"\n" + "Usage: java -jar hudson.war [--option=value] [--option=value]\n" +
" --daemon = fork into background and run as daemon (Unix only)\n" +
" --config = load configuration properties from here. Default is ./winstone.properties\n" +
" --prefix = add this prefix to all URLs (eg http://localhost:8080/prefix/resource). Default is none\n" +
" --commonLibFolder = folder for additional jar files. Default is ./lib\n" +
" --logfile = redirect log messages to this file\n" +
" --logThrowingLineNo = show the line no that logged the message (slow). Default is false\n" +
" --logThrowingThread = show the thread that logged the message. Default is false\n" +
" --debug = set the level of debug msgs (1-9). Default is 5 (INFO level)\n" +
" --httpPort = set the http listening port. -1 to disable, Default is 8080\n" +
" --httpListenAddress = set the http listening address. Default is all interfaces\n" +
" --httpDoHostnameLookups = enable host name lookups on incoming http connections (true/false). Default is false\n" +
" --httpsPort = set the https listening port. -1 to disable, Default is disabled\n" +
" if neither --httpsCertificate nor --httpsKeyStore are specified,\n" +
" https is run with one-time self-signed certificate.\n" +
" --httpsListenAddress = set the https listening address. Default is all interfaces\n" +
" --httpsDoHostnameLookups = enable host name lookups on incoming https connections (true/false). Default is false\n" +
" --httpsKeyStore = the location of the SSL KeyStore file.\n" +
" --httpsKeyStorePassword = the password for the SSL KeyStore file. Default is null\n" +
" --httpsCertificate = the location of the PEM-encoded SSL certificate file.\n" +
" (the one that starts with '-----BEGIN CERTIFICATE-----')\n" +
" must be used with --httpsPrivateKey.\n" +
" --httpsPrivateKey = the location of the PEM-encoded SSL private key.\n" +
" (the one that starts with '-----BEGIN RSA PRIVATE KEY-----')\n" +
" --httpsKeyManagerType = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509\n" +
" --ajp13Port = set the ajp13 listening port. -1 to disable, Default is 8009\n" +
" --ajp13ListenAddress = set the ajp13 listening address. Default is all interfaces\n" +
" --controlPort = set the shutdown/control port. -1 to disable, Default disabled\n" +
" --handlerCountStartup = set the no of worker threads to spawn at startup. Default is 5\n" +
" --handlerCountMax = set the max no of worker threads to allow. Default is 300\n" +
" --handlerCountMaxIdle = set the max no of idle worker threads to allow. Default is 50\n" +
" --simulateModUniqueId = simulate the apache mod_unique_id function. Default is false\n" +
" --useSavedSessions = enables session persistence (true/false). Default is false\n" +
" --usage / --help = show this message\n" +
" --version = show the version and quit\n" +
" --realmClassName = Set the realm class to use for user authentication. Defaults to ArgumentsRealm class\n" +
" --argumentsRealm.passwd.<user> = Password for user <user>. Only valid for the ArgumentsRealm realm class\n" +
" --argumentsRealm.roles.<user> = Roles for user <user> (comma separated). Only valid for the ArgumentsRealm realm class\n" +
" --fileRealm.configFile = File containing users/passwds/roles. Only valid for the FileRealm realm class\n" +
" --accessLoggerClassName = Set the access logger class to use for user authentication. Defaults to disabled\n" +
" --simpleAccessLogger.format = The log format to use. Supports combined/common/resin/custom (SimpleAccessLogger only)\n" +
" --simpleAccessLogger.file = The location pattern for the log file(SimpleAccessLogger only)");
Figures out the version from the manifest.
Figures out the URL of
hudson.war.
byte[] buf = new byte[8192];
while((len=in.read(buf))>0)
Extract a resource from jar, mark it for deletion upon exit, and return its location.
for (int i = 0; i < files.length; i++)
Determines the home directory for Hudson.
People makes configuration mistakes, so we are trying to be nice
with those by doing
java.lang.String.trim().