springBoot实现热部署:
一、引入依赖
只需要在pom中加入(springBoot官网(https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/using-boot-build-systems.html#using-boot-maven)找devtool依赖):spring-boot-devtools
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
二、在修改完文件后要build项目(IDEA中),一般快捷键为Ctrl+F9
--------------------------------------------------------------------------------------------------------------------------------------------------
springboot项目使用actuator配置监控点测试:
一、引入依赖
<!-- 引入Actuator监控依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
二、在配置文件中添加
### 1.5版本的添加下面的配置
management:
security:
enabled: false
### 2.0版本只有的就没有了Security内部类了,需要以下设置
方式一:
# 启用单个端点 env
management:
endpoint:
env:
enabled: true
# 暴露端点 env 配置多个,隔开.
endpoints:
web:
exposure:
include: env
方式二:
# 启用所有端点
management:
endpoints:
web:
exposure:
include: '*'
注意:若在核心配置文件中未添加 management.security.enabled=false 配置,将会导致用户在访问部分监控地址时访问受限,报401未授权错误。
下图取自于其他博客:
至于详细引用查看博客:https://blog.youkuaiyun.com/pengjunlee/article/details/80235390
,如果你加入了Spring Security ,在没有配置用户名密码的情况下,它会有默认的用户名密码:
默认用户名:user
默认密码会在你的控制台有打印(如图,类似红色框中就是你自己的默认密码):