I am using eclipse as IDE. When I right click on the project and then click maven update my java version change to 1.5. Here is what I did so far, I followed all the steps l
The root-cause of this issue is that if for any reason Eclipse's cannot resolve a valid value for the maven.compiler.source property when generating/updating the .classpath file from the pom, it will simply default to using org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5.
As expertly answered by @jorge-campos, there are multiple ways to set that property.
However, Jorge's answer didn't appear to work for me. Here were my settings:
1.8
${java.version}
${java.version}
...
Exactly. ${java.version} is never going to resolve to the (completely different) property javaVersion and Eclipse ignored the property and used the default.
Which brings me back to the "for any reason" part I opened with; developer stupidity can be one of those reasons.