「BUG」启动jar配置文件里的参数无法替换。

项目场景:

linux系统中启动springboot项目的jar,替换掉jar中原有的mysql配置。


问题描述:

启动脚本里,已经用通用的方式,java -jar xxx.jar --mysql.host=x.x.x.x:3306 -v,进行替换,但是执行的还是jar里bootstrap.yml中原有mysql地址配置。

原因分析:

分析也只能先是查看自己的启动脚本有没有问题,百度了各种原因,最终找到了,启动脚本没有错,为什么就是写不进去。

解决方案:

public class Application{

public static void main(String[] args){

SpringApplication.run(Application.class,args);

}

}

关键点:args,原来项目中 SpringApplication.run(Application.class);启动的时候少了args,导致启动的时候无法修改项目中的配置文件信息。

相关推荐
hui函数21 小时前
Python系列Bug修复|如何解决 pip install 安装报错 invalid command ‘bdist_wheel’(缺少 wheel)问题
python·bug·pip
hui函数21 小时前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有索引未设为 trusted-host 导致拒绝 问题
python·bug·pip
hui函数1 天前
Python系列Bug修复|如何解决 pip install 安装报错 Backend ‘setuptools.build_meta’ 不可用 问题
python·bug·pip
hui函数1 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有仓库认证失败 401 Unauthorized 问题
python·bug·pip
hui函数1 天前
Python系列Bug修复|如何解决 pip install -r requirements.txt 子目录可编辑安装缺少 pyproject.toml 问题
python·bug·pip
啊湘2 天前
VSCODE英文界面切换为中文(适用CURSOR等使用)
ide·vscode·编辑器·bug·cursor
hui函数2 天前
Python系列Bug修复|如何解决 pip install -e . 安装报错 “后端不支持可编辑安装(PEP 660)” 问题
python·bug·pip
一条咸鱼_SaltyFish2 天前
[Day16] Bug 排查记录:若依框架二次开发中的经验与教训 contract-security-ruoyi
java·开发语言·经验分享·微服务·架构·bug·开源软件
luming-023 天前
报错解决:IDEA终端输出和CMD终端输出Maven版本不一致
java·缓存·bug·intellij-idea
秃头小饼干3 天前
技术文章大纲:Bug悬案侦破大会
bug