问题背景:使用Maven开发一个SWT的小程序,使用maven-shade-plugin打包应用程序有主类。
出现错误,Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
Could not find the main class: com.XXX.YYY.ZZZ. Program will exit.
在网上找了不少解决方案,最后找到这个:
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<!-- Additional configuration. -->
</configuration>
需要把上面这段加到插件的运行配置里面。
原因:因为引用的版本的签名文件造成了版本混淆,实际上只需要排除即可。
SecurityException: Invalid signature file digest
猜你喜欢
转载自songix.iteye.com/blog/1850837
今日推荐
周排行