Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在maven中将context.xml从war中排除 org.apache.maven.plugins maven战争插件 2.4 src/main/webapp META-INF/context.xml_Maven_Maven War Plugin - Fatal编程技术网

如何在maven中将context.xml从war中排除 org.apache.maven.plugins maven战争插件 2.4 src/main/webapp 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

我有文件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</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>