"webxml attribute is required" error in Maven

user617966 picture user617966 · Mar 18, 2011 · Viewed 306.4k times · Source

I am getting the following error:

Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

I have got web.xml in right place which is projectname\src\main\webapp\WEB-INF\web.xml

What could be causing this?

Answer

Arpit picture Arpit · Mar 18, 2011

It would be helpful if you can provide a code snippet of your maven-war-plugin. Looks like the web.xml is at right place, still you can try and give the location explicitly

<plugin>            
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <webXml>src\main\webapp\WEB-INF\web.xml</webXml>        
  </configuration>
</plugin>