diff --git a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/jetty/JettyMetricsConfiguration.java b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/jetty/JettyMetricsConfiguration.java index c26a9ee82a..512ab73faf 100644 --- a/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/jetty/JettyMetricsConfiguration.java +++ b/micrometer-spring-legacy/src/main/java/io/micrometer/spring/autoconfigure/web/jetty/JettyMetricsConfiguration.java @@ -18,6 +18,7 @@ import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.binder.jetty.InstrumentedQueuedThreadPool; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -25,10 +26,8 @@ import java.util.Collections; @Configuration -@ConditionalOnClass(name = { - "org.eclipse.jetty.server.Server", - "org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory" -}) +@ConditionalOnClass(name = "org.eclipse.jetty.server.Server") +@ConditionalOnMissingClass("org.apache.catalina.startup.Tomcat") public class JettyMetricsConfiguration { @Bean