Using Eclipse with the m2eclipse plug-in, how do I update the pom.xml, so the “Maven->Update Project” won’t reset the project configuration back to Java 1.5? I am using Eclipse Kepler 4.3, Java 7, and the m2eclipse plug-in. I create a new Maven project with “Create a simple project (skip archetype selection)” checked and the artifactId “test”. I get the following warning.
Description Resource Path Location Type Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. test Build path JRE System Library Problem
I use the following steps the change the compiler from 1.5 to 1.7. 1. On the project, do right-click “Properties” and select the “Java build path”. 2. Go to the “Libraries” tab. 3. Remove the old JRE System Library [JavaSE-1.5]. 4. Click “Add Library…”, select “JRE System Library”, and click “Next>”. 5. Check “Execution environment” radio button and select “JavaSE 1.7 …” from the adjoining menu. 6. Click “Finish” 7. Click “OK”.
The warning disappears.
I right-click the project and select “Maven->Update Project”. I click “OK”.
The warning message returns.
My understanding is the plugin uses the pom.xml to update Eclipse’s current settings. How do I update the pom.xml, so the “Maven->Update Project” won’t reset the project configuration back to Java 1.5?
I looked at these pages, but I think the answers are obsolete. Warning - Build path specifies execution environment J2SE-1.4 What causes a new Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't? maven does not compile in java 1.6
For example, adding …
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
… after the version section in the POM doesn’t fix the problem.