How to exclude context.xml from war in maven

1.5k views Asked by At
<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>

I have File src/main/webapp/META-INF/context.xml

I want to exclude it from war file. I refered to official documentation and add plugin to pom. But it appears under demo.war/META-INF/context.xml

1

There are 1 answers

0
Constantine Gladky On
<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>

this works