Spring Cloud - Eureka /actuator/info 如何显示信息
在pom.xml中添加
<!-- actuator监控信息完善 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
<!-- 这里可以根据自己的需要,修改匹配规则 -->
<build> <finalName>${project.artifactId}</finalName> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <delimiters> <delimit>$</delimit> </delimiters> </configuration> </plugin> </plugins> </build>
在provider子模块的resources/application.properties中添加
info.app.name=amber-cloud-dept-8001
info.company.name=www.amber.com
info.build.artifactId=$project.artifactId$
info.build.version=$project.version$
再访问/actuator/info