コードには以下のように記述されています。
import org.springframework.boot.actuate.metrics.web.client.MetricsRestTemplateCustomizer;
ビルドしようとすると以下のようなエラーになります。
error: package org.springframework.boot.actuate.metrics.web.client does not exist
エラーを見ると、actuateより先が解決できないようです。(actuateのaの下に^が表示されます。)
build.gradleは以下のような内容です。(明らかに無関係な箇所は省略しています)
plugins {
id 'org.springframework.boot' version '2.1.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
}
group = 'jp.co.test.sample'
version = '0.0.1'
sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-stream'
implementation 'org.springframework.retry:spring-retry:1.2.4.RELEASE'
implementation "io.micrometer:micrometer-registry-prometheus:1.3.2"
}
どうすれば、org.springframework.boot.actuateをimportできるようになりますか?
gradle dependencies --configuration compileClasspath
コマンドで依存関係を出力できますが、その中にorg.springframework.boot:spring-boot-actuator:2.1.2.RELEASE
は含まれているでしょうか。~/.gradle/caches/modules-2/files-2.1
です)。