Commit 4cac9d73 authored by Phillip Webb's avatar Phillip Webb

Ensure actuator works without Spring MVC

Update MetricFilterAutoConfiguration to ensure that it is only applied
if Spring MVC is on the classpath.

Fixes gh-2542
parent 8e594c79
...@@ -53,7 +53,7 @@ import org.springframework.web.util.UrlPathHelper; ...@@ -53,7 +53,7 @@ import org.springframework.web.util.UrlPathHelper;
@Configuration @Configuration
@ConditionalOnBean({ CounterService.class, GaugeService.class }) @ConditionalOnBean({ CounterService.class, GaugeService.class })
@ConditionalOnClass({ Servlet.class, ServletRegistration.class, @ConditionalOnClass({ Servlet.class, ServletRegistration.class,
OncePerRequestFilter.class }) OncePerRequestFilter.class, HandlerMapping.class })
@AutoConfigureAfter(MetricRepositoryAutoConfiguration.class) @AutoConfigureAfter(MetricRepositoryAutoConfiguration.class)
public class MetricFilterAutoConfiguration { public class MetricFilterAutoConfiguration {
......
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId> <artifactId>spring-boot-starter-jersey</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment