spring-boot-admin的Github地址在:https://github.com/codecentric/spring-boot-admin
,它在Spring Boot Actuator的基础上提供简洁的可视化WEB UI。
搭建 Spring Boot Admin Server
创建一个 SpringBoot 2.0.3 RELEASE 工程并添加依赖
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <dependencies> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-server</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server-ui</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
|
应用主类添加注解
1 2 3 4 5 6 7 8
| @SpringBootApplication @EnableAdminServer public class SbaServer20Application {
public static void main(String[] args) { SpringApplication.run(SbaServer20Application.class, args); } }
|
启动 Spring Boot Admin Server
浏览器打开 localhost:8080,就可以看到小清新的页面了