# 將demo.properties及所在目錄解壓出來
jar -xvf test.war WEB-INF/demo.properties
# 對demo.properties文件進行修改,並覆蓋原有的demo.properties文件
cp demo.properties WEB-INF/demo.properties
# 將修改後的文件替換回war包
jar -uvf test.war WEB-INF/demo.properties
參考:https://blog.csdn.net/weixin_35982425/article/details/88241192