【问题标题】:How to exclude context.xml from war in maven如何在 Maven 中从战争中排除 context.xml
【发布时间】:2014-01-05 07:36:36
【问题描述】:
<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下

【问题讨论】:

    标签: maven maven-war-plugin


    【解决方案1】:
    <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>
    

    这行得通

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-13
      • 1970-01-01
      相关资源
      最近更新 更多