webxml attribute is required error on maven build of war

This error appears mostly when Maven could not find the web.xml file. If you are following the default maven structure, make sure the webapp folder is named correctly – like not webapps or something like that.
Once you make sure, you can try by explicitly telling maven where the web.xml file is using

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