mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Ensure tomcat on the classpath does not imply web application
This commit is contained in:
parent
9d2d34216b
commit
84a3e3827b
@ -45,6 +45,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnJava;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnJava.JavaVersion;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvider;
|
||||
@ -65,8 +66,8 @@ import org.springframework.lang.UsesJava7;
|
||||
@Configuration
|
||||
@AutoConfigureBefore(EndpointAutoConfiguration.class)
|
||||
@AutoConfigureAfter({ DataSourceAutoConfiguration.class, CacheAutoConfiguration.class,
|
||||
MetricRepositoryAutoConfiguration.class, CacheStatisticsAutoConfiguration.class,
|
||||
IntegrationAutoConfiguration.class })
|
||||
MetricRepositoryAutoConfiguration.class, CacheStatisticsAutoConfiguration.class,
|
||||
IntegrationAutoConfiguration.class })
|
||||
public class PublicMetricsAutoConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
@ -107,6 +108,7 @@ public class PublicMetricsAutoConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass({ Servlet.class, Tomcat.class })
|
||||
@ConditionalOnWebApplication
|
||||
static class TomcatMetricsConfiguration {
|
||||
|
||||
@Bean
|
||||
|
@ -24,6 +24,7 @@ import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainer
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -50,6 +51,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({ Servlet.class, ServerContainer.class })
|
||||
@ConditionalOnWebApplication
|
||||
@AutoConfigureBefore(EmbeddedServletContainerAutoConfiguration.class)
|
||||
public class WebSocketAutoConfiguration {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user