如何在maven中将context.xml从war中排除 org.apache.maven.plugins maven战争插件 2.4 src/main/webapp META-INF/context.xml
我有文件src/main/webapp/META-INF/context.xml 我想从war文件中排除它。我参考了官方文档并将插件添加到pom中。但是它出现在demo.war/META-INF/context.xml下如何在maven中将context.xml从war中排除 org.apache.maven.plugins maven战争插件 2.4 src/main/webapp META-INF/context.xml,maven,maven-war-plugin,Maven,Maven War Plugin,我有文件src/main/webapp/META-INF/context.xml 我想从war文件中排除它。我参考了官方文档并将插件添加到pom中。但是它出现在demo.war/META-INF/context.xml下 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin&l
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>src/main/webapp</directory>
<!-- there's no default value for this -->
<excludes>
<exclude>META-INF/context.xml</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>
org.apache.maven.plugins
maven战争插件
2.4
META-INF/context.xml
这很有效
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceExcludes>META-INF/context.xml</warSourceExcludes>
</configuration>
</plugin>