![](/img/trans.png)
[英]Directory not creating other than WEB-INF & META-INF in WAR using Maven pom.xml
[英]maven - why is my pom.xml NOT removing META-INF/*.SF, META-INF/*.DSA and META-INF/*.RSA?
在我的pom.xml
,有以下<plugin>
部分:
<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>
但是,每当我使用mvn clean install -U
构建项目时,都会mvn clean install -U
某些.SF,.DSA和.RSA复制到已构建的jar文件中,因此我需要手动删除它们。
如何纠正呢?
标签<excludes>的正确用法如下:
<excludes>META-INF/*.SF,META-INF/*.DSA,META-INF/*.RSA</excludes>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.