Reputation: 1609
I created an empty web project using Eclipse Mars and Maven 3.3.3. For now, this project only contains the pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.project</groupId>
<artifactId>web-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<build>
<plugins>
<!-- <plugin> -->
<!-- <groupId>org.apache.maven.plugins</groupId> -->
<!-- <artifactId>maven-war-plugin</artifactId> -->
<!-- <version>2.6</version> -->
<!-- <configuration> -->
<!-- <failOnMissingWebXml>false</failOnMissingWebXml> -->
<!-- </configuration> -->
<!-- </plugin> -->
</plugins>
</build>
</project>
Now Eclipse complains about a missing web.xml
file. From the documentation of the maven-war-plugin one can set the user property failOnMissingWebXml
, so there is no need to further configure this plugin. This works using Maven from the command line, the project is build successfully. But Eclipse still complains about the missing web.xml.
Does anybody know how to get rid of this Maven configuration error in Eclipse by just using this user property?
Update: I have another development environment using Eclipse Luna SR1 and Maven 3.2.5 where it does not complain about the missing web.xml in a newly created web project. So I wonder if this error is somehow suppressed by the m2e plugin.
Upvotes: 3
Views: 8777
Reputation: 2101
Installing wtp-m2e 1.2.1
from http://download.eclipse.org/m2e-wtp/snapshots/mars/ fixes this issue for me.
Upvotes: 3