Only try to auto-configure Jetty when jetty-webapp is on the classpath

Closes gh-4089
pull/4212/head
Andy Wilkinson 9 years ago
parent 87a515f6a0
commit a94f3a0cbf

@ -21,6 +21,7 @@ import javax.servlet.Servlet;
import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.Tomcat;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.webapp.WebAppContext;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanFactoryAware;
@ -82,7 +83,7 @@ public class EmbeddedServletContainerAutoConfiguration {
* Nested configuration if Jetty is being used. * Nested configuration if Jetty is being used.
*/ */
@Configuration @Configuration
@ConditionalOnClass({ Servlet.class, Server.class, Loader.class }) @ConditionalOnClass({ Servlet.class, Server.class, Loader.class, WebAppContext.class })
@ConditionalOnMissingBean(value = EmbeddedServletContainerFactory.class, search = SearchStrategy.CURRENT) @ConditionalOnMissingBean(value = EmbeddedServletContainerFactory.class, search = SearchStrategy.CURRENT)
public static class EmbeddedJetty { public static class EmbeddedJetty {

Loading…
Cancel
Save