BladeX/doc/other/env.md
2019-01-30 17:06:23 +08:00

30 lines
500 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 环境变量
#### 环境划分
> 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注意是大写
```