这边在linux 启动springboot的jar包时候,多次报错 最终使用

java -jar -Dspring.profiles.active=test demo-0.0.1-SNAPSHOT.jar的方式成功

Maven启动指定Profile通过-P,如mvn spring-boot:run -Ptest,但这是Maven的Profile。

如果要指定spring-boot的spring.profiles.active,spring-boot 1.x 使用mvn spring-boot:run -Drun.profiles=test,spring-boot 2.x 使用mvn spring-boot:run -Dspring-boot.run.profiles=test。参考资料:https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE/maven-plugin/examples/run-profiles.html

如果使用命令行直接运行jar文件,则使用java -jar -Dspring.profiles.active=test demo-0.0.1-SNAPSHOT.jar

如果使用开发工具,运行Application.java文件启动

则增加参数--spring.profiles.active=test

最新文章

  1. begin
  2. MongoDB安装及添加到Windows服务,随系统启动
  3. jmeter 与 java http
  4. mysql中替换字符串(正则) 模糊
  5. -- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
  6. 2016-2017 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred) 几道简单题的题解
  7. 1009 FatMouse' Trade
  8. org
  9. maven是什么?(转自oracle官网)
  10. 让IE支持CSS3 Media Query实现响应式Web设计
  11. Global.asax文件的说明
  12. css selector: xpath:
  13. java中 try return finally return(转)
  14. Visual studio code快捷键
  15. NET应用——使用RSA构建相对安全的数据交互
  16. 通过javap终极理解++i和i++的区别
  17. SQLServer数据事务日志操作
  18. bzoj5110: [CodePlus2017]Yazid 的新生舞会
  19. 高德地图添加marker及反地理编码获取POI
  20. ZOJ2067 经典 DP(单调队列优化)

热门文章

  1. mysql中有条件的插入语句
  2. 11 Python之初识函数
  3. 语句:if语句、do-while语句、while语句、for语句、for-in语句、with语句、label语句、switch语句以及break和continue语句;
  4. less 经典范例 bootstrap 的 less 版本 常用 less 代码
  5. MySQL索引之数据结构及算法原理
  6. 利用python3 调用zabbix接口完成批量加聚合图形(screens)
  7. wiki部署
  8. Linux查看系统开机和关机时间
  9. redis弱密码漏洞利用
  10. C#将html table 导出成excel实例