[Solved-4 Solutions] “webxml attribute is required” error in Maven
Error Description:
- We get the following error:
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- We have got
web.xml
in right place which isprojectname\src\main\webapp\WEB-INF\web.xml
- What could be causing this?
Solution 1:
- The value of my webXml tag need to look like this in order to work:
Solution 2:
- If we are migrating from XML-based to Java-based configuration and we have removed the need for web.xml by implementing WebApplicationInitializer, we need to simply remove the requirement for the web.xml file to be present.
Solution 3:
- A quick fix is to create a
src/main/java
and asrc/main/webapp
directory (and other directories if we need them) and just move the files.
Solution 4:
- Make a new folder named WEB-INF under src/main/webbapp then
- Right Click on the Project -> Java EE Tools -> Generate Deployment Descriptor Stub
- This should generate the web.xml.