Thursday, October 16, 2025
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
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11953 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS