启动后台jar包时,如何应用特定application.yml配置文件?

2026-05-16 07:052阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计355个文字,预计阅读时间需要2分钟。

启动后台jar包时,如何应用特定application.yml配置文件?

启动JAR包,指定配置文件`application.yml`,使用`nohup`后台运行:`nohup java -jar vPaas.jar --spring.config.location=/opt/vpaas-conf/application.yml /opt/vpaas-conf/nohup.out 21`。如不希望将`application.properties`作为配置文件名,可调整命令参数。

jar 包启动时指定配置文件 application.yml

nohup java -jar vPaas.jar --spring.config.location=/opt/vpaas-conf/application.yml > /opt/vpaas-conf/nohup.out 2>&1 &

如果不喜欢将 application.properties 作为配置文件名,你可以通过指

定 spring.config.name 环境属性来切换其他的名称,也可以使

用 spring.config.location 环境属性引用一个明确的路径(目录位置或文件路

指定配置文件:

--spring.config.location=/opt/vpaas-conf/application.yml

将所有的调试信息输入到:

/opt/vpaas-conf/nohup.out

补充知识:启动jar包并放入后台运行脚本

我就废话不多说了,大家还是直接看代码吧~

nohup java -jar smart_city_manager_banner.jar > smart_city_manager_banner.out 2>&1 &
nohup java -jar smart_city_manager_banner.jar > smart_city_manager_banner.out 2>&1 &
tail -f smart_city_manager_banner.out
ps aux |grep java

以上这篇在启动后台 jar包时,使用指定的 application.yml操作就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易盾网络。

启动后台jar包时,如何应用特定application.yml配置文件?
标签:jar

本文共计355个文字,预计阅读时间需要2分钟。

启动后台jar包时,如何应用特定application.yml配置文件?

启动JAR包,指定配置文件`application.yml`,使用`nohup`后台运行:`nohup java -jar vPaas.jar --spring.config.location=/opt/vpaas-conf/application.yml /opt/vpaas-conf/nohup.out 21`。如不希望将`application.properties`作为配置文件名,可调整命令参数。

jar 包启动时指定配置文件 application.yml

nohup java -jar vPaas.jar --spring.config.location=/opt/vpaas-conf/application.yml > /opt/vpaas-conf/nohup.out 2>&1 &

如果不喜欢将 application.properties 作为配置文件名,你可以通过指

定 spring.config.name 环境属性来切换其他的名称,也可以使

用 spring.config.location 环境属性引用一个明确的路径(目录位置或文件路

指定配置文件:

--spring.config.location=/opt/vpaas-conf/application.yml

将所有的调试信息输入到:

/opt/vpaas-conf/nohup.out

补充知识:启动jar包并放入后台运行脚本

我就废话不多说了,大家还是直接看代码吧~

nohup java -jar smart_city_manager_banner.jar > smart_city_manager_banner.out 2>&1 &
nohup java -jar smart_city_manager_banner.jar > smart_city_manager_banner.out 2>&1 &
tail -f smart_city_manager_banner.out
ps aux |grep java

以上这篇在启动后台 jar包时,使用指定的 application.yml操作就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易盾网络。

启动后台jar包时,如何应用特定application.yml配置文件?
标签:jar