【问题标题】:Spring Boot Admin Client can not be build无法构建 Spring Boot Admin Client
【发布时间】:2019-12-28 19:33:30
【问题描述】:

我正在尝试将我的 Spring Boot 应用程序配置为 Admin Client,但在设置以下依赖项后无法构建它:

    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-starter-client</artifactId>
        <version>2.1.6</version>
    </dependency>

pom.xml 中设置此依赖项后尝试构建应用程序时出现以下错误:

Description:

尝试调用方法 org.springframework.boot.web.client.RestTemplateBuilder.setConnectTimeout(Ljava/time/Duration;)Lorg/springframework/boot/web/client/RestTemplateBuilder;但它不存在。它的类 org.springframework.boot.web.client.RestTemplateBuilder 可从以下位置获得:

jar:file:/Users/sherzad/.m2/repository/org/springframework/boot/spring-boot/2.0.6.RELEASE/spring-boot-2.0.6.RELEASE.jar!/org/springframework/boot/web/client/RestTemplateBuilder.class

它是从以下位置加载的:

file:/Users/sherzad/.m2/repository/org/springframework/boot/spring-boot/2.0.6.RELEASE/spring-boot-2.0.6.RELEASE.jar

行动:

更正应用程序的类路径,使其包含一个兼容的 org.springframework.boot.web.client.RestTemplateBuilder 版本

我不知道为什么它有两个相同的 RestTemplateBuilder...

如何解决这个问题?

【问题讨论】:

  • 请附上 mvn 依赖:树结果,并尝试使用 spring-boot-admin-starter-client - 2.0.6 版本
  • 你到底是什么意思?我应该在我的项目中使用这个dependency:tree 做什么?
  • mvn 依赖项的输出:树,请您尝试使用 spring-boot-admin-starter-client - 2.0.6 版本
  • 谢谢!更改为 2.0.6 版 - 并且成功了!

标签: java spring spring-boot client admin


【解决方案1】:

你能试试 spring-boot-admin-starter-client - 2.0.6 版本

希望对你有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-25
    • 1970-01-01
    • 1970-01-01
    • 2018-03-22
    • 1970-01-01
    • 1970-01-01
    • 2014-10-13
    • 1970-01-01
    相关资源
    最近更新 更多