19 Feb 2013

Error assembling WAR: webxml attribute is required.

Problem: Error assembling WAR: webxml attribute is required.

[INFO] ----------------------------------------------------------- [INFO] BUILD FAILURE [INFO] ----------------------------------------------------------- [INFO] Total time: 1.694s [INFO] Finished at: Tue Feb 05 15:21:46 CST 2013 [INFO] Final Memory: 10M/21M [INFO] ----------------------------------------------------------- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project {project name}: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]

Cause: The maven-war-plugin plugin is not configured.

Solution:Add the following section in the pom.xml.

pom.xml

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>

6 comments:

snekse said...

A better solution might be to just tell the plugin where your web.xml file is located.


WebRoot\WEB-INF\web.xml

Unknown said...

@snekse: Since Java EE6 there is no requirement for having web.xml in web project.

Anonymous said...

It helped me. Thank you, for sharing it!

Shreyas said...

Thanks it saved my time :)

devblogs said...

I tried the same in eclipse. But still it is showing me same error. Please help.

Unknown said...

Thanks, it saved my time