Spring Cloud - Eureka /actuator/info 如何顯示資訊
阿新 • • 發佈:2018-12-11
在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