qnsh
V2EX  ›  问与答

springboot 打成 jar 包后用压缩软件手动修改依赖的 jar 包的配置文件报错

  •  
  •   qnsh · Dec 11, 2018 · 4774 views
    This topic created in 2888 days ago, the information mentioned may be changed or developed.

    springboot 项目打成 jar 包后想修改 jar 包配置文件,用压缩软件手动修改依赖的 jar 包的配置文件报错 Unable to open nested entry It has been compressed and nested jar files must be stored without compression。 应该如何正确的操作。

    2 replies  •  2018-12-11 11:42:42 +08:00
    armoni
    armoni
    Dec 11, 2018
    1
    配置文件放 jar 外面
    akiakiseofficial
    akiakiseofficial
    Dec 11, 2018 via iPhone
    2
    按我的理解,如果想修改 application.properties 里的配置,应该在运行时手动覆盖,比如我要修改 spring.profiles.active 的值:

    java -jar app.jar -Dspring.profiles.active=test

    或者重新打包。

    用压缩软件修改....感觉不好。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1770 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:50 · PVG 13:50 · LAX 21:50 · JFK 00:50
    ♥ Do have faith in what you're doing.