简体   繁体   中英

maven - why is my pom.xml NOT removing META-INF/*.SF, META-INF/*.DSA and META-INF/*.RSA?

On my pom.xml I have the following <plugin> section:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>
<plugin> 
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.8</version>
        <executions>
            <execution>
                <id>copy-dependencies</id>
                <phase>prepare-package</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <excludeScope>system</excludeScope>
                    <excludes>META-INF/*.SF</excludes>
                    <excludes>META-INF/*.DSA</excludes>
                    <excludes>META-INF/*.RSA</excludes>
                    <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
                    <outputDirectory>${project.build.directory}/classes/lib/</outputDirectory>
                     <includeScope>runtime</includeScope>
                 </configuration>
             </execution>
         </executions>
</plugin>

But, whenever I build the project with a mvn clean install -U , some .SF, .DSA and .RSA are copied to the built jar file and I need to remove them manually.

How to correct this?

标签<excludes>的正确用法如下:

<excludes>META-INF/*.SF,META-INF/*.DSA,META-INF/*.RSA</excludes>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM