use of org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext in project gradle by gradle.
the class AbstractJettyRunTask method configureWebApplication.
/**
* Subclasses should invoke this to setup basic info on the webapp.
*/
public void configureWebApplication() throws Exception {
//way of doing things
if (webAppConfig == null) {
webAppConfig = new JettyPluginWebAppContext();
}
webAppConfig.setContextPath(getContextPath().startsWith("/") ? getContextPath() : "/" + getContextPath());
if (getTemporaryDir() != null) {
webAppConfig.setTempDirectory(getTemporaryDir());
}
if (getWebDefaultXml() != null) {
webAppConfig.setDefaultsDescriptor(getWebDefaultXml().getCanonicalPath());
}
if (getOverrideWebXml() != null) {
webAppConfig.setOverrideDescriptor(getOverrideWebXml().getCanonicalPath());
}
// Don't treat JCL or Log4j as system classes
Set<String> systemClasses = new LinkedHashSet<String>(Arrays.asList(webAppConfig.getSystemClasses()));
systemClasses.remove("org.apache.commons.logging.");
systemClasses.remove("org.apache.log4j.");
webAppConfig.setSystemClasses(systemClasses.toArray(new String[0]));
webAppConfig.setParentLoaderPriority(false);
LOGGER.info("Context path = " + webAppConfig.getContextPath());
LOGGER.info("Tmp directory = " + " determined at runtime");
LOGGER.info("Web defaults = " + (webAppConfig.getDefaultsDescriptor() == null ? " jetty default" : webAppConfig.getDefaultsDescriptor()));
LOGGER.info("Web overrides = " + (webAppConfig.getOverrideDescriptor() == null ? " none" : webAppConfig.getOverrideDescriptor()));
}
Aggregations