Skip to content
Related Articles
Open in App
Not now

Related Articles

How to Resolve WEB xml is missing and failOnMissingWebXml is set to true in Eclipse/STS?

Improve Article
Save Article
  • Last Updated : 28 Apr, 2022
Improve Article
Save Article

Eclipse/STS IDE is generally used to develop Spring applications and what happens is whenever we are creating a simple Maven project and if the web.xml is missing or you have deleted that file then you may encounter this problem inside the pom.xml file corresponding to which do refer to the below image as follows: 


Now we are going to discuss how can we resolve this error via discussing two ways to fix this error which are as follows:

  1. Modifying the pom.xml file.
  2. Generating Deployment Descriptor Stub.

Solution 1: Modification in the pom.xml file

The simple and best solution for this problem is, just write the following line of code inside the <properties> tag something like this.


And this will resolve the error. Refer to the below image. 


Note: We can see the error has been gone. 

Solution 2: Generate Deployment Descriptor Stub

The other solution is, click on your project > right-click > Java EE Tools > Generate Deployment Descriptor Stub as shown in the below image. 


And this will generate the web.xml file inside the WEB-INF folder with some pre-defined code as shown in the below image. And it will also resolve the error. 


Tip: Now heeks you must be wondering which way is better so straight forward answer is that Solution 1 is a better solution than adding an empty web.xml because this way the final product stays clean, we are just changing the build parameters.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!