-
Notifications
You must be signed in to change notification settings - Fork 7
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
WST unable to update Maven configuration: Version 8 of project facet java does not exist. #26
Comments
WTP does not have a version "8" of its Java facet. It's always used "1.8". I can add aliases, but I don't believe this is new |
So looks like this bit (100% calling WST API) :
now returns 8 instead of 1.8. Looks like something has changed in WST. I need to investigate to understand what changed. cc @nitind |
Hello, I'm facing the same error
while all my pom.xml are specifying JDK17 as the 'release' property of maven-compiler-plugin in this way:
Wondering how is this '8' version still affecting the work, should I file a separate ticket? |
Was there more to that stack trace? And was this under 2023-06? |
I'm surprised you see that error if all your projects target release 17. Please provide a sample project reproducing this error. |
|
@fbricon I'll try to prepare a minimal test case. |
Stacktrace says you have an EAR project with some lib/ dependencies, at least one of them might still be compiled using Java 8 |
@fbricon finally I got what was causing the problem. My local M2 repo contained old versions of the artifacts of the project, which had Java8 in their pom.xml Even though the 'Workspace resolution' is ON, it seems M2E at some point doesn't take it first from the workspace and relies on the local M2 repo. |
the facet configuration only applies to workspace projects, so it should have worked |
@fbricon maybe transitive dependencies caused that (although they're also part of the workspace...) |
Just upgraded to eclipse 2023-06 and ran into the same issue. Ended up downgrading back to 2023-03 to be able to continue working. Eagerly watching for a fix :) |
Here is a test case to reproduce the issue: https://bitbucket.org/alexlitovsky1/eclipse-m2e-bug/ |
The fix was done in upstream m2e: eclipse-m2e/m2e-core#1414 Please try the latest m2e snapshot from this p2 repository |
@fbricon I confirm that the original problem is not reproduced anymore for me after installing M2E 2.4.100.20230705-1302 and importing Maven projects some of which have 1.8 and some - 17 Java compiler compatibility. |
When updating from the snapshot repository, do I need only everything in the "Maven Integration for Eclipse" category, or also things under the "Maven Embedded Runtimes" and "Uncategorized" categories? |
Just "Maven Integration for Eclipse" should be enough. Dependencies that need to be updated will be updated by the way. |
I upgraded to Eclipse EE 2023-06 RC1 (4.28.0 RC1) on Windows 10 and things started breaking. (This issue was first reported at eclipse-m2e/m2e-core#1414 but I was told that this is related to WST.)
In my long-running https://github.com/globalmentor/globalmentor-root project I have a
pom.xml
for Java 8 with the following line:The correct value for
<maven.compiler.release>
is 8. See Setting the--release
of the Java Compiler.This is a Java compiler 9+ option (why it's needed is a long story), but there shouldn't be any problem with that. I'll just use a JDK version 9+ when building. And in fact in Eclipse I have the following JRE registered:
I have another project https://github.com/globalmentor/globalmentor-base which uses
globalmentor-root
as its parent. In Eclipse EE 2023-06 if I try to refresh the project usingAlt+F5
, it tells me:What does that mean? It has something to do with
<maven.compiler.release>8</maven.compiler.release>
in theglobalmentor-root
project, because if I change it to<maven.compiler.release>11/maven.compiler.release>
, then suddenly I can refreshglobalmentor-base
.But I want to release those two libraries for Java 8, not Java 11. It shouldn't matter that a JDK 9+ is required to build it.
Are you suddenly using the
<maven.compiler.release>8/maven.compiler.release>
to restrict the JDK used to build the project? Themaven.compiler.release
flag is to determine the target API, not to restrict the JDK being used to build the project. See JEP 247: Compile for Older Platform Versions.Note that I have both
globalmentor-root
andglobalmentor-base
in my workspace, both set to-SNAPSHOT
versions (minor upgrades).This was working on Eclipse 2023-3 and for years earlier. If I can't find a way around this I'm going to have to roll back.
Here's a stack trace. Interestingly it mentions
globalmentor-core
andglobalmentor-management
, which are subprojects ofglobalmentor-base
:Currently my workaround is:
globalmentor-root
and set<maven.compiler.release>11/maven.compiler.release>
.globalmentor-base
and useAlt+F5
to refresh the Maven project.globalmentor-root
and set<maven.compiler.release>8/maven.compiler.release>
as it was before.Apparently this is sneaky enough that the new Eclipse doesn't notice and doesn't complain. I'll cross my fingers to see if it continues to work.
Unfortunately this means I'll need need to go through those workaround steps again if I ever need to refresh the
globalmentor-base
Maven project in Eclipse again.The text was updated successfully, but these errors were encountered: