1.springboot与微服务
2.随机占位符
3.spring动态切换环境
3.1spring boot打成jar包在cmd下运行:
1.右键项目—>Run As—>Maven build—>Goals输入package
2.刷新target,右键jar包—>Properties—>Location右边的小箭头点下去,进入到jar根目录
3. 搜索框输入cmd,回车
4.dos命令输入java -jar HelloWorld-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev,回车
5.效果如下图:
-
通过命令行 调用外部配置文件
4.1 spring boot打成jar包在cmd下运行:
1.右键项目—>Run As—>Maven build—>Goals输入clean package
2.刷新target,右键jar包—>Properties—>Location右边的小箭头点下去,进入到jar根目录- 搜索框输入cmd,回车
4.dos命令输入java -jar HelloWorld-0.0.1-SNAPSHOT.jar – spring.config.location=F:/application.properties,回车
5.效果如下图:
- 搜索框输入cmd,回车
-
模板引擎 thymeleaf