banner
李大仁博客

李大仁博客

天地虽大,但有一念向善,心存良知,虽凡夫俗子,皆可为圣贤。

Solving the error of creating a new Maven project pom file in Eclipse

Recently, when creating a Maven project in Eclipse, an error occurred in the pom.xml file: web.xml is missing and is set to true.

After careful investigation, the reason is that the project did not generate the web.xml file, which is related to the newer versions of JDK and Eclipse, where the default mechanism is to generate projects with Dynamic Web Module 3.0.

In general, you would choose to copy a web.xml file and modify it for your own project. However, there is a simpler method:

org.apache.maven.plugins

maven-war-plugin

false

By adding these lines of code, you won't need the web.xml file anymore.

Okay, the problem is resolved! Setting failOnMissingWebXml to false means ignoring the detection mechanism for the missing web.xml file. It is worth mentioning that in the era of Dynamic Web Module 3.0 projects, there is no need for web.xml file to register related content, so the project does not generate web.xml by default.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.