//apply any config from a jetty.xml file first which is able to
//be overwritten by config in the pom.xml
applyJettyXml ();
JettyPluginServer plugin=getServer();
// if the user hasn't configured their project's pom to use a
// different set of connectors,
// use the default
Object[] configuredConnectors = getConfiguredConnectors();
plugin.setConnectors(configuredConnectors);
Object[] connectors = plugin.getConnectors();
if (connectors == null|| connectors.length == 0)
{
//if a SystemProperty -Djetty.port=<portnum> has been supplied, use that as the default port
configuredConnectors = new Object[] { plugin.createDefaultConnector(System.getProperty(PORT_SYSPROPERTY, null)) };
plugin.setConnectors(configuredConnectors);
}
//set up a RequestLog if one is provided
if (getConfiguredRequestLog() != null)
getServer().setRequestLog(getConfiguredRequestLog());
//set up the webapp and any context provided
getServer().configureHandlers();
configureWebApplication();
getServer().addWebApplication(webAppConfig);
// set up security realms
Object[] configuredRealms = getConfiguredUserRealms();
for (int i = 0; (configuredRealms != null) && i < configuredRealms.length; i++)
getLog().debug(configuredRealms[i].getClass().getName() + ": "+ configuredRealms[i].toString());
plugin.setUserRealms(configuredRealms);
//do any other configuration required by the
//particular Jetty version
finishConfigurationBeforeStart();