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?
It works perfectly for me too.
If you change the default project path, you must specify the location of the web.xml file, for example:
I had the exact same problem and i solved it like this :
Make a new folder named
WEB-INF
undersrc/main/webbapp
thenRight Click on your Project -> Java EE Tools -> Generate Deployment Descriptor Stub
This should generate your
web.xml
I hope this helps by solving your problem :D
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 explicitlyAs per the documentation, it says : Whether or not to fail the build if the web.xml file is missing. Set to false if you want you WAR built without a web.xml file. This may be useful if you are building an overlay that has no web.xml file. Default value is: true. User property is: failOnMissingWebXml.
Hope it makes more clear
I have had the same error on the test server but not in local. After a few minutes, I discovered that the IDE wasn't synchronized with the pom.xml. Here is how I solve it:
Re-Generate the deployment descriptor with Eclipse
Re-Generate the deployment descriptor with IntelliJ