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.
- Go to project
Build Path
and change the Java Library version to1.7
- Go to Eclipse Preferences -> Java -> Compiler -> Change compliance level to
1.7
- Right click on project -> Properties -> Project Facets
- Uncheck
Dynamic Web Module
and click Apply (also uncheckJavaServer Faces
if you had that) - Change the
Java
facet version to1.7
and click Apply - 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:
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>