我在pom.xml中有一个部分
<filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>Meta-INF/*.SF</exclude> <exclude>Meta-INF/*.DSA</exclude> </excludes> </filter> </filters>
我想从最后的jar中排除* .SF和* .DSA文件.
但是我收到以下消息:
[INFO] No artifact matching filter *:*
并且不排除文件.
有谁知道如何克服它?
解决方法
我有同样的问题.它是通过使我的神器选择器更具体的固定,例如
<artifact>bouncycastle:*</artifact>
整个块看起来像这样:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.mycompany.MainClass</mainClass> </transformer> </transformers> <filters> <filter> <artifact>bouncycastle:*</artifact> <excludes> <exclude>Meta-INF/*.SF</exclude> <exclude>Meta-INF/*.DSA</exclude> <exclude>Meta-INF/*.RSA</exclude> </excludes> </filter> </filters> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>standalone</shadedClassifierName> </configuration> </execution> </executions> </plugin> <plugin>