Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Yangkai.Shen a88c88ac0a | 7 years ago | |
---|---|---|
.. | ||
src | 7 years ago | |
README.md | 7 years ago | |
pom.xml | 7 years ago |
依赖spring-boot-demo-parent、服务端依赖 spring-boot-demo-admin
和 spring-boot-admin-server-ui
、客户端依赖 spring-boot-admin-starter-client
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-demo-admin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-demo-admin</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>com.xkcoding</groupId>
<artifactId>spring-boot-demo-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../spring-boot-demo-parent/pom.xml</relativePath>
</parent>
<properties>
<admin.server.version>1.5.2</admin.server.version>
<admin.server.ui.version>1.5.2</admin.server.ui.version>
<admin.client.version>1.5.2</admin.client.version>
</properties>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>${admin.server.version}</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>${admin.server.ui.version}</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${admin.client.version}</version>
</dependency>
</dependencies>
<build>
<finalName>spring-boot-demo-admin</finalName>
</build>
</project>
server:
port: 8080
context-path: /demo
spring:
application:
# 可视化管控台展示的监控项目名,不设置,会使用自动生成的名字
name: Spring Boot Admin
boot:
admin:
# 可视化管控台界面的 context-path
context-path: /spa
url: http://localhost:${server.port}/${server.context-path}
jackson:
serialization: true
# 去除权限校验
endpoints:
sensitive: false
@SpringBootApplication
@EnableAdminServer // 开启管控台
@RestController
public class SpringBootDemoAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootDemoAdminApplication.class, args);
}
@GetMapping("/")
public Map<String, Object> index() {
ConcurrentMap<String, Object> ret = Maps.newConcurrentMap();
ret.put("msg", "Hello Spring Boot Admin");
return ret;
}
}
http://localhost:8080/demo/spa 即可查看管控台主页,点击项目的 Detail
即可查看详细信息,但是比起 actuator
提供的端点监控,看起来确实美观不少,但是都各有优缺点。
一个用来深度学习并实战 spring boot 的项目,目前总共包含 66 个集成demo,已经完成 55 个。
Java SVG CSS JavaScript SQL other