Maven Java EE Configuration

After following above troubleshooting steps. Update your maven project.

Right click on your project--> Maven--> Update Project

Or simply Alt+f5.

Hope this might help someone.


  1. Go to project Build Path and change the Java Library version to 1.7
  2. Go to Eclipse Preferences -> Java -> Compiler -> Change compliance level to 1.7
  3. Right click on project -> Properties -> Project Facets
  4. Uncheck Dynamic Web Module and click Apply (also uncheck JavaServer Faces if you had that)
  5. Change the Java facet version to 1.7 and click Apply
  6. Add the Dyanmic Web Module v3.0, apply.

Eclipse's facets configuration is buggy. Make sure you keep hitting Apply between checking and unchecking of facets.

Links:

  • Cannot change version of project facet Dynamic Web Module to 3.0?
  • Change version of project facet Dynamic Web Module to 2.5

  • GGrec's solution doesn't work for me. I manage to fixed this issue by adding to pom.xml this:

    <build>
         <finalName>finalName</finalName>
         <plugins>
    
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source> <!-- yours Java version -->
                    <target>1.8</target> <!-- yours Java version -->
                </configuration>
            </plugin>
    
        </plugins>
    </build>
    

    UPDATE: In addition I figured out that everytime you run mvn install command on this pom.xml it overrides previous configuration. The right solution is either remove this version from pom.xml and set it up in eclipse options or just use configuration from pom.xml.


    Also as Kefas I am specify java version to 1.7 and it works!

     <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
             <source>1.7</source> 
             <target>1.7</target> 
        </configuration>
    </plugin>