@Configuration @EnableAutoConfiguration @EnableAdminServer
1.使用idea新建一个springboot工程,并修改pom.xml,添加admin依赖
de.codecentric spring-boot-admin-server 1.5.6 de.codecentric spring-boot-admin-server-ui 1.5.6 de.codecentric spring-boot-admin-starter-client 1.5.6
注意点:springboot的高版本可能会不支持,所以可以采用稳定的版本
2.修改springboot启动配置文件 application.properties/ application.yml 文件,添加配置(其中端口,可以自行
配置)
server.port=8081 management.security.enabled=false spring.boot.admin.url=http://localhost:8081/
3.在启动类添加启动admin注解
@Configuration @EnableAutoConfiguration @EnableAdminServer
4.启动功能,显示如下,则说明成功,然后拷贝图下的地址,输入浏览器中,则可以显示admin配置信息
浏览器输入,springboot-admin 显示结果:
源码地址:https://gitee.com/chui0704/springboot.git
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/218106.html原文链接:https://javaforall.net
