java.lang.SecurityException:没有用于签名文件条目的清单部分

我已尝试过其他主题的建议,但他们没有帮助我。 当我通过java -jar -BigJar.jar运行我的jar时,我收到exception:

Exception in thread main java.lang.SecurityException: no manifest section for signature fil entry edu/iris/Pissures/IfSeismogramMgr/MotionVectorAttributeHelper.class

我的ant文件是

  USGS VHP Main Build File      Available targets: help -- displays this help information init -- clean -- deletes lib/*.jar files touch -- touch *.java in source tree contrib -- download the contrib library (use before building) build -- build the USGS codebase (use after checkout *)                                                                                                                                                                                                                                                          

如您所见,我从每个jar中排除了RSA,SF和DSA文件以及MANIFEST.MF。

但它不能帮我解决这个错误。

如果你知道smth请回复。

谢谢!

看起来你可能两次包括jar子。 首先使用zipgroupfilesets,然后再使用一系列zipfilesets。

您可以删除zipgroupfilesets。

我相信你的排除也存在问题。 您可以将其更改为:

      

或这个:

  

有关详细信息,请参阅http://ant.apache.org/manual/Types/fileset.html(zipfileset是文件集的一种forms)。

另一方面,这样的事情可能会简化一些事情:

                  

我在http://nt.apache.org/manual/Tasks/jar.html的“合并档案”部分的示例中对此进行了调整。

此错误消息确切地说明了为什么不建议将捆绑jar用于生产版本。 问题是你的一些依赖jar用签名文件签名。 重新打包它可能会违反依赖jar上的某些安全策略。

要使其工作,您需要从已签名的jar中删除所有签名文件,然后将解压缩的文件复制到最终的构建jar文件中。

  org.apache.maven.plugins maven-shade-plugin   package  shade     ${project.artifactId}-${project.version}-uber   *:*  META-INF/*.SF META-INF/*.DSA META-INF/*.RSA      

只需删除导入的签名jar中的* .SF文件(在meta_inf文件夹中)