You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
500 B

2 years ago
## 环境变量
#### 环境划分
> dev(开发)、test(测试)、prod(正式),默认dev
#### 添加环境变量
##### java命令行:
```
java -jar gateWay.jar --spring.profiles.active=dev
```
##### JAVA_OPS
```
set JAVA_OPTS="-Dspring.profiles.active=test"
```
##### 标注方式(代码层面,junit单元测试非常实用)
```
@ActiveProfiles({"junittest","productprofile"})
```
##### ENV方式
```
系统环境变量SPRING_PROFILES_ACTIVE(注意:是大写)
```