spring boot jar包替换报错之Unable to open nested entry 'BOOT-INF/lib/cache-api-0.4.jar'.


spring boot用layout ZIP打出来的包能够支持外部classpath,但是当用rar/7zip替换其中的jar后,报下列错误:

Unable to open nested entry 'BOOT-INF/lib/cache-api-0.4.jar'. It has been compressed and nested jar files must be stored without compression.

 解决方法:

jar包可以替换的,过程如下:
jar -xvf ta-base-service-TABASEV201913.00.000-SNAPSHOT.jar
### 替换内容
jar -cfM0 ta-base-service-TABASEV201913.00.000-SNAPSHOT.jar ./
不能用rar或7-zip替换

最好方式还是将应用的jar放在spring boot主应用jar外面的目录中。这可以通过maven-jar-plugin来实现将某些jar不打包到spring boot应用jar中,而是放在特定目录中。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM