首页 文章

如何从maven中的war中排除context.xml

提问于
浏览
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>

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

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

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>
    

    这很有效

相关问题