Consider:
When I create a simple Maven project in Eclipse I am getting this error:
web.xml is missing and
For Project with web.xml present Project-->Properties-->Deployment Assembly,where you can add Folder src/main/webapp. Save change. Clean the project to get going.
For Project with web.xml not present Set failOnMissingWebXml to false in pom.xml under properties tag.
Select your project and select the "Deployment Descriptor" option and then choose "Generate Deployment Descriptor stub"
I encountered this issue in eclipse only, everything worked fine in Maven command line, and my web.xml file existed. It was a mature project (already deployed out in production) that was impacted. My problem was tied to the eclipse metadata. There was an issue with one of the files in my .settings/ folder, specifically org.eclipse.wst.common.component had been changed. I was able to restore this file to its prior version, which resolved the issue in my case.
Note that Yuci's answer did not work for me, when I tried to click on Deployment Assembly in the eclipse properties, I got an error that said "the currently displayed page contains invalid values."
I have the same problem. After studying and googling, I have resolved my problem:
Right click on the project folder, go to Java EE Tools
, select Generate Deployment Descriptor Stub
. This will create web.xml
in the folder src/main/webapp/WEB-INF
.
The step of : Select your project and select the "Deployment Descriptor" option and then choose "Generate Deployment Descriptor stub" works fine. The issue is that it is not always the case that we need web.xml, so it is best to append false to pom.xml
I had the same problem, even though I had 'src/main/webapp/WEB-INF/'
folder with correct web.xml
.
The problem disappeared after I recreated (maven->eclipse) configuration with
Maven build..
I executed mvn eclipse:clean eclipse:eclipse
And then I used Maven -> Update Project
to add (eclipse->maven) plugin specific options.