banner
李大仁博客

李大仁博客

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

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

title: "Solving the error of creating a new Maven project pom file in Eclipse"
date: "2015-12-08"
tags:

  • "dynamic-web-module-3-0"
  • "eclipse"
  • "failonmissingwebxml"
  • "jdk"
  • "maven"

Recently, I created a Maven project in Eclipse and encountered an error in the pom.xml file: "web.xml is missing and is set to true".

After investigating, I found that the project did not generate a web.xml file, which is related to the newer versions of JDK and Eclipse, where the default mechanism is to generate projects using Dynamic Web Module 3.0.

In general, we would copy a web.xml file and modify it for our own project. However, there is a simpler method:

org.apache.maven.plugins maven-war-plugin false

By adding these lines of code, we no longer need a web.xml file.

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

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