Skip to content
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

Support for m2e 2.0.x (Eclipse 2022-09) #1405

Closed
andham opened this issue Oct 12, 2022 · 22 comments
Closed

Support for m2e 2.0.x (Eclipse 2022-09) #1405

andham opened this issue Oct 12, 2022 · 22 comments
Assignees
Labels
Milestone

Comments

@andham
Copy link

andham commented Oct 12, 2022

Eclipse Groovy 4.7.0 seems to be only compatible with Eclipse M2E 1.x. When trying to install "Groovy-Eclipse M2E integration" in Eclipse 2022-09 I get:

Cannot complete the install because one or more required items could not be found.
Software being installed: Groovy-Eclipse M2E integration 4.7.0.v202209301526-e2209-RELEASE (org.codehaus.groovy.m2eclipse.feature.feature.group 4.7.0.v202209301526-e2209-RELEASE)
Missing requirement: Groovy m2e integration 4.7.0.v202209301526-e2209-RELEASE (org.codehaus.groovy.m2eclipse 4.7.0.v202209301526-e2209-RELEASE) requires 'osgi.bundle; org.eclipse.m2e.core [1.9.1,2.0.0)' but it could not be found
Cannot satisfy dependency:
From: Groovy-Eclipse M2E integration 4.7.0.v202209301526-e2209-RELEASE (org.codehaus.groovy.m2eclipse.feature.feature.group 4.7.0.v202209301526-e2209-RELEASE)
To: org.eclipse.equinox.p2.iu; org.codehaus.groovy.m2eclipse [4.7.0.v202209301526-e2209-RELEASE,4.7.0.v202209301526-e2209-RELEASE]

The org.eclipse.m2e.core component in Eclipse 2022-09 is version 2.0.3. Thus it fails the specified range [1.9.1,2.0.0). Please support M2E in newer Eclipse versions.

@chrylis
Copy link

chrylis commented Oct 12, 2022

I got bitten by a recent upgrade within 4.24, so I tried a clean 4.25 and ran into this problem myself.

@eric-milles
Copy link
Member

@eric-milles
Copy link
Member

eric-milles commented Oct 13, 2022

I can try to work around some of the API changes. GroovyProjectConfigurator depends on the JDT M2E framework. So I'd need for that to be updated or rewrite to be standalone.

@chrylis
Copy link

chrylis commented Oct 13, 2022

So all the breakage is due to someone wanting to use the Cool New Feature and Did Not Think This Through?

@eric-milles
Copy link
Member

Eclipse M2E is now Java 17 minimum when Eclipse IDE is Java 11 minimum. I don't understand the decision making process.

@chrylis
Copy link

chrylis commented Oct 13, 2022

I tried installing m2e 1.20.1 from the repository as suggested, and I ended up with

M2E - Maven Integration for Eclipse (includes Incubating components)	1.20.1.20220227-1319	org.eclipse.m2e.feature.feature.group	Eclipse.org - m2e

I also have the Groovy support installed from the 4.25 snapshots with

Eclipse Groovy Development Tools	4.8.0.v202210112349-e2209	org.codehaus.groovy.eclipse.feature.feature.group	Pivotal Software, Inc.

I'm getting a ClassCastException that looks like some OSGI classloader glitch:

java.lang.ClassCastException: class org.apache.maven.plugin.MojoExecution cannot be cast to class org.apache.maven.plugin.MojoExecution (org.apache.maven.plugin.MojoExecution is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @34989ceb; org.apache.maven.plugin.MojoExecution is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @1406926b)
	at org.codehaus.groovy.m2eclipse.GroovyProjectConfigurator.addJavaProjectOptions(GroovyProjectConfigurator.java:107)
	at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configure(AbstractJavaProjectConfigurator.java:153)
	at org.codehaus.groovy.m2eclipse.GroovyProjectConfigurator.configure(GroovyProjectConfigurator.java:49)
	at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:124)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$2(ProjectConfigurationManager.java:515)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:156)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:509)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:447)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$1(ProjectConfigurationManager.java:362)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:156)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:103)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1411)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:361)
	at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:80)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Does this look familiar? (Should I take this to a different ticket?)

Edit: The m2e update had smuggled in a "POM Editor" component that was causing OSGI dependency weirdness. Uninstalling it seems to have fixed the problem.

@hazendaz
Copy link

hazendaz commented Dec 6, 2022

@eric-milles Can you check again and see if 2.1.3 snapshot from m2e works again? They did relax back to java 8 on few items that were using 17.

Snapshots for them https://download.eclipse.org/technology/m2e/snapshots/latest/

They did release 2.1.0 but didn't fix the java 8 issue until afterwards. Admittedly, m2e is a mess right now but it was forced into newer eclipse builds. Its stable enough to use ignoring all its issues, so really from here if it could be tested to confirm 2.1.3.x works, maybe we can get them to release that one so those of us having issues can re-enable this project.

@eric-milles
Copy link
Member

Looking at the source, the org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest has not changed, so the incompatibility remains.

@brunorozendo
Copy link

works with:
eclipse 2022-09 (4.25)
https://download.eclipse.org/technology/m2e/snapshots/latest/
https://dist.springsource.org/release/GRECLIPSE/e4.25

image

@eric-milles Can you check again and see if 2.1.3 snapshot from m2e works again? They did relax back to java 8 on few items that were using 17.

Snapshots for them https://download.eclipse.org/technology/m2e/snapshots/latest/

They did release 2.1.0 but didn't fix the java 8 issue until afterwards. Admittedly, m2e is a mess right now but it was forced into newer eclipse builds. Its stable enough to use ignoring all its issues, so really from here if it could be tested to confirm 2.1.3.x works, maybe we can get them to release that one so those of us having issues can re-enable this project.

@kwin
Copy link

kwin commented Dec 17, 2022

Is it too early to drop support of m2e 1.x? Supporting both 1.x and 2.x with the same underlying code is close to impossible. Look at the workarounds e.g. applied to bnd in bndtools/bnd#5429 to support both.

@papegaaij
Copy link

Please move Eclipse Groovy to m2e 2.x. This issue is preventing me from updating my eclipse in its entirety. I need m2e and getting the old m2e working in Eclipse 4.27 and up is close to impossible, especially with the other plugins I also need, which have already moved to m2e 2.x.

@eric-milles
Copy link
Member

@papegaaij You can remove the m2e groovy feature and go forward with m2e 2.x. Then you just need to manage adding groovy nature for maven projects that you import.

Please move Eclipse Groovy to m2e 2.x. This issue is preventing me from ...

Donate button is right here: https://github.com/groovy/groovy-eclipse/wiki

@papegaaij
Copy link

@eric-milles Don't get me wrong, I greatly appreciate the work you do on Eclipse Groovy. I was under the impression that you were trying to support both m2e 1.x and 2.x and just wanted to voice my opinion about just moving to 2.x. I normally help OSS projects by donating time in the form of comprehensive bug reports and/or pull requests. Unfortunately, the build system for eclipse plugins is a bit outside my field of expertise, but I can ask a colleague for assistance if you are willing to accept a pull request for m2e 2.x support.

@eric-milles
Copy link
Member

eric-milles commented Jan 10, 2023

Not ready for a PR on this just yet. I have a couple options to consider:

  1. Create a separate project for m2e 2.x support, leaving m2e 1.x project as-is. Would need to figure out how to integrate it in pom.xml and some more details.
  2. Cut ties with m2e 1.x and support 2.x only. What would happen to support for older eclipse releases?
  3. Create a cross-compatible solution like bndtools did. Wouldn't be the first time we had to resort to reflection to smooth out API issues.

As mentioned above, GroovyProjectConfigurator extends the Java one. If JDT does not deal with m2e 2.x, we'd need to stop extending AbstractJavaProjectConfigurator and somehow implement the functionality that we get from it.

You can drop the Groovy M2E feature and create a plug-in that provides what you need from it and supports m2e 2.x. There would be far fewer design considerations since you only need to worry about m2e 2.x and one eclipse release. You could even try this using the groovy-eclipse codebase. Just download from github, drop the m2e 1.x site from pom.xml, change the version range in org.codehaus.groovy.m2eclipse/META-INF/MANIFEST.MF, rework GroovyProjectConfigurator and run mvn -Pe4.27 package to create the plugin in Site-org.codehaus.groovy.eclipse/target/ that you can move to your dropins folder.

@reckart
Copy link

reckart commented Jan 11, 2023

My 10 cents - drop m2e 1 and move on just to 2.

Side node: I recently upgraded to Tycho 3 and that forced me to update my build environment from Java 11 to Java 17; installing Eclipse 2020-12 brought with it a Java 19 runtime for Eclipse which forced me to upgrade from Groovy 3 to Groovy 4; being compatible with older ecosystems doesn't seem hip anymore...

eric-milles added a commit that referenced this issue Jan 11, 2023
@eric-milles eric-milles added this to the v4.9.0 milestone Jan 11, 2023
@eric-milles
Copy link
Member

... Java 19 runtime for Eclipse which forced me to upgrade from Groovy 3 to Groovy 4

Groovy 3 will run on Java 19 except for the proxy stuff. So if you don't do Interface i = { -> ... } you should be okay. But yes, Groovy 4 supports Java 16+ changes that required more MethodHandle stuff.

@reckart
Copy link

reckart commented Jan 11, 2023

The problem with Groovy was apparently the version of ASM in the latest Groovy 3 version - I didn't dig down to the nasty details. I tried to override it in the dependencies of the groovy-maven-plugin but without much luck. Upgrading to Groovy 4 worked then.

@eric-milles
Copy link
Member

@andham @kwin @papegaaij @hazendaz ready to test

@hazendaz
Copy link

Sorry unable to test at the moment due to #1425

@papegaaij
Copy link

Thanks for the work on this. I'll give it a try next week. I was a bit occupied troubleshooting a nasty hibernate issue last week.

@papegaaij
Copy link

I can confirm that the current snapshot works fine with eclipse 2022-09 with m2e 2.1. I did ran into #1425, but was able to work around that with steps provided in one of the comments.

@hazendaz
Copy link

Hi @papegaaij I'm planning to try that work around too but mistakenly tried to remove items the installer complained about with groovy which broke eclipse entirely so I had to start over with fresh copy and I'm working on rebuilding all plugins back :( I hope in next couple days to be there, Eclipse has been an utter mess in my opinion for last year plus. I support building a shipable copy with lots of plugins for some 400 to 500 developers and haven't published in a year. Its been one thing after another. Not heartbroken yet but also hoping 2023-03 doesn't have yet more surprises and more-so hoping m2e gets their act fully together before then given we are a maven shop and m2e is super confused on how to setup java. :( This here was last big missing piece in recent usage due to m2e. In the end, its all good things happening but has been really rough to live through this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants