Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360649

Summary: JRE by default when creating a maven project
Product: z_Archived Reporter: tweetysat Mising name <tweetysat2001>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description tweetysat Mising name CLA 2011-10-12 07:19:53 EDT
Build Identifier: 20110916-0149

I'm working with m2e plugin version 1.0.100.20110804-1717.

There is only one 'installed jre' : jdk1.6.0_23 (c:\....\jdk1.6.0_23)

If I do new maven project ... create a simple project (or any other archetype), the project is created with jre system library : J2SE-1.5 containing some jars from c:\....\jdk1.6.0_23\jre\lib. 

And there is a warning message :
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. JRE System Library Problem.

The pom.xml is only containing

<project xmlns="...maven.apache.org/POM/4.0.0" xmlns:xsi="...www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="...maven.apache.org/POM/4.0.0 ...maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>toto</groupId>
<artifactId>toto</artifactId>
<version>0.0.1-SNAPSHOT</version>
</project>

So I have to add manually, for each project,

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

How to fix the problem ?

Reproducible: Always

Steps to Reproduce:
1.Create new maven project
2.
3.
Comment 1 Igor Fedorenko CLA 2011-10-12 09:16:31 EDT
The observed behaviour is expected and desired. m2e matches workspace project JRE to the java version configured in pom.xml.
Comment 2 tweetysat Mising name CLA 2011-10-12 10:01:50 EDT
(In reply to comment #1)
> The observed behaviour is expected and desired. m2e matches workspace project
> JRE to the java version configured in pom.xml.

Thanks, but wichh pom.xml ?
When creating a new maven project, there is not yet a pom.xml.  And the file created does not contains any jre references.
Comment 3 Igor Fedorenko CLA 2011-10-12 10:08:51 EDT
Maven (maven-compiler-plugin, to be precise) provides default java level.
Comment 4 Denis Roy CLA 2021-04-19 13:23:38 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/