Search code examples
javaeclipsemavenm2eclipseservlet-4

Cannot change version of project facet Dynamic Web Module to 3.1


Why does maven insist on changing my Dynamic Web Module to 3.1 in my eclipse project? I want it to remain 4.0. Is there a way to tell maven I want Servlet spec 4.0? So far, the Maven documentation has not provided an answer to this for me.

Here are parts of my pom:

       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <inherited>true</inherited>
            <configuration>
                <source>10</source>
                <target>10</target>
            </configuration>
      </plugin>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.2.1</version>
          <configuration>
              <failOnMissingWebXml>false</failOnMissingWebXml>
          </configuration>
      </plugin>

Servlet jar:

<dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
          <version>4.0.1</version>
          <scope>provided</scope>             
</dependency>

Eclipse project settings:

project settings

m2e error:

m2e error

I'm using eclipse oxygen with Java 10 and tomcat 9. I have tried closing and reopening my project, making small changes and then Maven Updating my project, deleting the maven config errors to see if they come back after updating (they come back) and other similar trial and error type things. So far, nothing has worked.


Solution

  • Related bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=530958

    Please try using m2e-wtp 1.4.0. At the moment, the latest milestone build is available from http://download.eclipse.org/m2e-wtp/milestones/photon/1.4/.