From 5280cfeec053d94dfca1314e415e8310d67a0b5f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 10 Oct 2023 16:39:12 +0100 Subject: [PATCH] Adapt to breaking API change in Micrometer See gh-37703 --- .../spring-boot-actuator-autoconfigure/build.gradle | 2 +- .../jms/JmsTemplateObservationAutoConfiguration.java | 2 +- .../jms/JmsTemplateObservationAutoConfigurationTests.java | 4 ++-- spring-boot-project/spring-boot-actuator/build.gradle | 2 +- spring-boot-project/spring-boot-docs/build.gradle | 2 +- .../MyReactorNettyClientConfiguration.kt | 4 ++-- .../spring-boot-starter-actuator/build.gradle | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 38cfeca464..14d6c88a0b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -37,7 +37,7 @@ dependencies { optional("io.dropwizard.metrics:metrics-jmx") optional("io.lettuce:lettuce-core") optional("io.micrometer:micrometer-observation") - optional("io.micrometer:micrometer-core") + optional("io.micrometer:micrometer-jakarta9") optional("io.micrometer:micrometer-tracing") optional("io.micrometer:micrometer-tracing-bridge-brave") optional("io.micrometer:micrometer-tracing-bridge-otel") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfiguration.java index faa7db23e6..9629468e60 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.actuate.autoconfigure.observation.jms; -import io.micrometer.core.instrument.binder.jms.JmsPublishObservationContext; +import io.micrometer.jakarta9.instrument.jms.JmsPublishObservationContext; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; import jakarta.jms.Message; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfigurationTests.java index 3abd6c1d64..dd097676b2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/observation/jms/JmsTemplateObservationAutoConfigurationTests.java @@ -51,8 +51,8 @@ class JmsTemplateObservationAutoConfigurationTests { } @Test - void shouldBackOffWhenMircrometerCoreIsNotPresent() { - this.contextRunner.withClassLoader(new FilteredClassLoader("io.micrometer.core")).run((context) -> { + void shouldBackOffWhenMicrometerJakartaIsNotPresent() { + this.contextRunner.withClassLoader(new FilteredClassLoader("io.micrometer.jakarta")).run((context) -> { JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class); assertThat(jmsTemplate).extracting("observationRegistry").isNull(); }); diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 3f7999ca49..e9a027a00e 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -22,7 +22,7 @@ dependencies { optional("com.zaxxer:HikariCP") optional("io.lettuce:lettuce-core") optional("io.micrometer:micrometer-observation") - optional("io.micrometer:micrometer-core") + optional("io.micrometer:micrometer-jakarta9") optional("io.micrometer:micrometer-tracing") optional("io.micrometer:micrometer-registry-prometheus") optional("io.prometheus:simpleclient_pushgateway") { diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index fed9578b54..f2eac01891 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -89,7 +89,7 @@ dependencies { implementation(project(path: ":spring-boot-project:spring-boot-devtools")) implementation("ch.qos.logback:logback-classic") implementation("com.zaxxer:HikariCP") - implementation("io.micrometer:micrometer-core") + implementation("io.micrometer:micrometer-jakarta9") implementation("io.micrometer:micrometer-tracing") implementation("io.micrometer:micrometer-registry-graphite") implementation("io.micrometer:micrometer-registry-jmx") diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/httpclients/webclientreactornettycustomization/MyReactorNettyClientConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/httpclients/webclientreactornettycustomization/MyReactorNettyClientConfiguration.kt index 85c140e3f0..1dac3ab5de 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/httpclients/webclientreactornettycustomization/MyReactorNettyClientConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/httpclients/webclientreactornettycustomization/MyReactorNettyClientConfiguration.kt @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.http.client.reactive.ClientHttpConnector import org.springframework.http.client.reactive.ReactorClientHttpConnector -import org.springframework.http.client.reactive.ReactorResourceFactory +import org.springframework.http.client.ReactorResourceFactory import reactor.netty.http.client.HttpClient @Configuration(proxyBeanMethods = false) diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle index 3e2a471593..0ff356b4e0 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle @@ -8,5 +8,5 @@ dependencies { api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) api(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) api("io.micrometer:micrometer-observation") - api("io.micrometer:micrometer-core") + api("io.micrometer:micrometer-jakarta9") }