Invalid signature file digest for Manifest main attributes
时间: 2024-05-19 17:07:17 浏览: 14
Invalid signature file digest for Manifest main attributes是指在执行jar包时,由于签名文件的摘要无效而导致的错误。这通常是由于签名文件被篡改或损坏所致。解决方案如下:
1. 手动删除文件:可以手动删除META-INF目录下的所有.SF、.DSA和.RSA文件,然后重新打包jar包。
2. 使用maven打包插件排除:在pom.xml文件中,使用maven打包插件的<configuration>标签中添加如下代码:
```
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Signature-Version>1.0</Signature-Version>
<Created-By>1.8.0_131 (Oracle Corporation)</Created-By>
<Build-Jdk>1.8.0_131</Build-Jdk>
<Main-Class>com.example.Main</Main-Class>
</manifestEntries>
</archive>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
```
这样就可以排除签名文件,避免出现Invalid signature file digest for Manifest main attributes的错误。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)