Spring 启动 2.0.0.RC1 无法访问信息端点

Spring boot 2.0.0.RC1fails to access info endpoint

我刚刚将 spring 启动依赖项从 2.0.0.M7 更新到 2.0.0.RC1。 之前每件事都运行良好。但是现在我收到错误,即每当我尝试访问信息端点时。

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'commit.id' to java.util.Map<java.lang.String, java.lang.Object>

我已将 application.yml 设置为

   management:
    info:
      git:
       enabled: true
       mode: full

RC1 文档具有相同的配置。

当 git 模式设置为 full 时,Spring Boot 2.0.0.RC1 中的 regression 导致了您的问题。您可以通过从 YAML 文件中删除 mode: full 行来解决此问题。