java - How can I exclude *.DSA and *.SF files from shaded jar? -


i have section in pom.xml

 <filters>    <filter>       <artifact>*:*</artifact>          <excludes>             <exclude>meta-inf/*.sf</exclude>             <exclude>meta-inf/*.dsa</exclude>          </excludes>    </filter> </filters> 

i want exclude *.sf , *.dsa files final jar. following message:

[info] no artifact matching filter *:* 

and files not excluded. know how overcome it?

i had same problem. fixed making artifact selector more specific, e.g.

<artifact>bouncycastle:*</artifact> 

the entire block looks this:

<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> 

Comments