Spring启动管理-info.version

Spring启动管理-info.version,spring,spring-boot,spring-boot-admin,Spring,Spring Boot,Spring Boot Admin,我们有一个使用自定义上下文路径的服务。为了在Eureka服务器上正确注册我们的服务,我们设置了以下内容: eureka.instance.statusPageUrl=http://xxx/custom/info eureka.instance.healthCheckUrl=http://xxx/custom/health eureka.instance.homePageUrl=http://xxx/custom/ 这工作正常,我们的应用程序已注册。然而,尽管我们已经设置了info.versio

我们有一个使用自定义上下文路径的服务。为了在Eureka服务器上正确注册我们的服务,我们设置了以下内容:

eureka.instance.statusPageUrl=http://xxx/custom/info
eureka.instance.healthCheckUrl=http://xxx/custom/health
eureka.instance.homePageUrl=http://xxx/custom/
这工作正常,我们的应用程序已注册。然而,尽管我们已经设置了
info.version
信息,但它不会显示在
Spring Boot Admin
主页上。对于没有自定义上下文路径的应用程序,它可以工作:


知道哪些属性最终丢失了吗?

您需要将以下内容添加到pom.xml中:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>build-info</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

org.springframework.boot