Sefler Sefler - 11 days ago 7
Java Question

Disable Maven warning message - "Selected war files include a WEB-INF/web.xml which will be ignored"

When building WAR package using Maven 2.1.1, I get this warning message:

[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ig
nored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specifi
ed as 'true')


Is there a way to eliminate it? It doesn't fail the building process, but I just do not want to see it.

Answer

I got rid of this warning in maven 3.0.1 with the following build configuration (i believe perhaps web.xml is added to the project by other means, and should't be packaged by default):

<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <packagingExcludes>WEB-INF/web.xml</packagingExcludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    ...
</project>