-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M2E wrongly uses enforcer requireJavaVersion to configure projects #1099
Comments
This is a bit strange. IIRC the I hope this isn't another regression from #981. The relevant class is probably m2e-core/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java Lines 173 to 176 in 50a9dc9
|
While analyzing the problem I noticed that Tycho in general and therefore the projects you mentioned have a maven-enforcer-plugin execution with a Since in the properties section |
To my understanding the requireJavaVersion rule is meant to clarify the version of the JVM that Maven itself runs on. It does not say anything about the source, target or other compiler/testing/runtime related Java levels of the modules being worked on. |
Neither does the underlying JRE Library do that, that is configured separately in the Eclipse JDT Compiler settings. The reason why m-e-p configuration is evaluated is that the project's JRE Library is also used for running Maven from Eclipse by default ( m2e-core/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java Line 249 in ad43099
m2e-core/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java Line 221 in ad43099
I agree that on the long term it would be good if m2e would establish a separate configuration for the JVM used to run Maven (but currently this is the project's JRE system library). |
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099
I'm using Maven with:
The annoying thing is that since m2e now looks at the enforcer plugin instead of the compiler target means that in Eclipse, stuff is compiled against Java 11 and not against Java 8 as the toolchains/compiler properties indicate. Please, it would be great if you could switch back to the old behavior. |
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava This closes eclipse-m2e#1134 This closes eclipse-m2e#1099 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava Closes eclipse-m2e#1134 Closes eclipse-m2e#1099 Closes eclipse-m2e#1120 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
The value is automatically derived from maven-enforcer rule requireJava Closes eclipse-m2e#1134 Closes eclipse-m2e#1099 Closes eclipse-m2e#1120 Co-authored-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
Please try the latest m2e release to verify that the issue is fixed as expected: |
Since eclipse-tycho/tycho#1740 all the classpaths in Tycho use Java 17 on my machine. That's clearly wrong, at least these 2 projects had other settings before (and they use specific other source/target values in their POMs):
I have Java 8, 11, 17 in my workspace preferences and I have all necessary EE levels mapped in the workspace preferences.
The text was updated successfully, but these errors were encountered: