4

jar包启动时指定profle没生效

 2 years ago
source link: https://www.oschina.net/question/2319418_2324110
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

jar包启动时指定profle没生效

_斯人若彩虹 发布于 昨天 10:44

服务器版本信息:CentOS Linux release 7.9.2009 (Core)

Springboot版本:Spring Boot v2.2.5.RELEASE, Spring v5.2.4.RELEASE

启动jar使用如下命令行:

第一种:nohup java -jar  helloworld.jar --spring.profiles.active=test &

第二种:nohup java -jar  -Dspring.profiles.active=test helloworld.jar &

问题:第一种方式指定的profile=test没生效,第二种的生效了。请大神能分析下这两种启动方式的差异。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK