故障安全错误:使用阴影插件时"Invalid signature file digest for Manifest main attributes"



当在maven中使用shade插件,然后尝试使用故障保护插件运行集成测试时,在故障保护即将运行时,我收到以下错误,导致我的集成测试被跳过:

[ERROR] Invalid signature file digest for Manifest main attributes

此错误似乎是由依赖项中的已签名jar引起的。这个答案建议使用依赖插件来过滤掉签名,但它似乎对我不起作用。Shade插件只是解包了所有的依赖,并没有解决问题。我怎样才能做到这一点?

过滤掉签名似乎是正确的方法,但可以(也许应该(直接在shade插件中完成,而不需要任何其他插件。这在shade-plugins网站上有隐含的文档,在那里它谈到了工件过滤器。我确保我的shade插件执行包括以下过滤器,它起作用了:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>

最新更新