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

JavaMavenMaven 2

Java Problem Overview


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.

Java Solutions


Solution 1 - Java

It seems to be fixed in current version of maven-war-plugin, so just specifying:

    <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
    </plugin>

fixed it for me. (See the last answer (20/Sep/12 4:37 AM) from Anders Hammar on https://issues.apache.org/jira/browse/MWAR-248.)

Solution 2 - Java

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>

Solution 3 - Java

I've filed the following bug report regarding this issue: https://issues.apache.org/jira/browse/MWAR-248

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSeflerView Question on Stackoverflow
Solution 1 - JavaanreView Answer on Stackoverflow
Solution 2 - JavaAndrei AmarieiView Answer on Stackoverflow
Solution 3 - JavaGiliView Answer on Stackoverflow