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

我有文件 src/main/webapp/META-INF/context.xml

我想将它从战争文件中排除。我参考了官方文档并在 pom.xml 中添加了插件。但它出现在 demo.war/META-INF/context.xml 下

4

1 回答 1

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

这行得通

于 2013-12-17T14:16:50.840 回答