Friday, January 30, 2026
HomeLanguagesJavaHow to Resolve WEB xml is missing and failOnMissingWebXml is set to...

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

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.

<properties>
    <failOnMissingWebXml>false</failOnMissingWebXml>
</properties>

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.

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32478 POSTS0 COMMENTS
Milvus
122 POSTS0 COMMENTS
Nango Kala
6849 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12065 POSTS0 COMMENTS
Shaida Kate Naidoo
6987 POSTS0 COMMENTS
Ted Musemwa
7222 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6917 POSTS0 COMMENTS