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

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

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.

 解决方法:api

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

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

相关文章
相关标签/搜索