在启动后台 jar包时,使用指定的 application.yml操作
作者:倪默遥 时间:2023-01-08 20:10:12
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
来源:https://blog.csdn.net/nimoyaoww/article/details/79108101
标签:jar,application.yml
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SpringBoot整合mybatis-plus进阶详细教程
2023-11-27 05:13:12
![](https://img.aspxhome.com/file/2023/6/61836_0s.png)
RestTemplate自定义请求失败异常处理示例解析
2021-12-03 22:13:17
![](https://img.aspxhome.com/file/2023/0/60700_0s.png)
java selenium Selenium IDE介绍及用法
2023-11-21 06:41:22
![](https://img.aspxhome.com/file/2023/7/58717_0s.gif)
Spring Boot 2.7.6整合redis与低版本的区别
2023-11-11 19:44:56
![](https://img.aspxhome.com/file/2023/7/59697_0s.png)
解决spring mvc 多数据源切换,不支持事务控制的问题
2022-09-30 03:39:56
java HashMap和HashTable的区别详解
2023-08-10 18:41:56
C#如何通过匿名类直接使用访问JSON数据详解
2023-07-20 12:31:53
![](https://img.aspxhome.com/file/2023/7/67057_0s.jpg)
IOS 实现摇一摇的操作
2023-07-02 13:46:53
SpringMVC bean加载控制的实现分析
2023-08-08 18:46:19
![](https://img.aspxhome.com/file/2023/2/57912_0s.png)
SpringBoot Nacos实现自动刷新
2023-09-16 04:17:09
使用@pathvariable与@requestparam碰到的一些问题及解决
2023-11-27 16:30:34
![](https://img.aspxhome.com/file/2023/9/60459_0s.png)
Java web访问localhost报404错误问题的解决方法
2023-07-27 05:28:55
![](https://img.aspxhome.com/file/2023/3/57913_0s.png)
servlet异步请求的实现
2023-07-14 17:11:38
![](https://img.aspxhome.com/file/2023/4/57724_0s.png)
Java经典面试题最全汇总208道(三)
2023-11-15 23:30:42
![](https://img.aspxhome.com/file/2023/6/59066_0s.jpg)
深入理解java内置锁(synchronized)和显式锁(ReentrantLock)
2023-11-19 00:10:57
kafka并发写大消息异常TimeoutException排查记录
2023-11-27 23:07:11
![](https://img.aspxhome.com/file/2023/8/60368_0s.png)
如何自动生成Mybatis的Mapper文件详解
2023-07-28 08:20:54
![](https://img.aspxhome.com/file/2023/8/57938_0s.jpg)
Android使用URL读取网络资源的方法
2023-07-27 10:56:39
![](https://img.aspxhome.com/file/2023/6/63836_0s.png)
Java集合TreeSet用法详解
2023-11-10 22:53:34
![](https://img.aspxhome.com/file/2023/4/59354_0s.jpg)
Spring Boot启动过程(四)之Spring Boot内嵌Tomcat启动
2023-09-21 00:16:18
![](https://img.aspxhome.com/file/2023/7/58577_0s.png)