groovy-eclipse icon indicating copy to clipboard operation
groovy-eclipse copied to clipboard

Getting "NoSuchMethodError: 'org.apache.maven.project.MavenProject org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getMavenProject()'"

Open davidmichaelkarr opened this issue 3 years ago • 3 comments

I very recently installed Eclipse 2022-09, with m2e 2.0.5.20220912-1211 and 4.7.0.v202209192046-e2209 of the "Groovy-Eclipse M2E integration".

Whenever I try to update a Maven project, I get an error dialog about "An internal error occurred during: "Updating Maven Project".". The error log has this:

!ENTRY org.eclipse.core.jobs 4 2 2022-09-20 13:51:08.188 !MESSAGE An internal error occurred during: "Updating Maven Project". !STACK 0 java.lang.NoSuchMethodError: 'org.apache.maven.project.MavenProject org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getMavenProject()' at org.codehaus.groovy.m2eclipse.GroovyProjectConfigurator.addJavaProjectOptions(GroovyProjectConfigurator.java:108) at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configure(AbstractJavaProjectConfigurator.java:167) at org.codehaus.groovy.m2eclipse.GroovyProjectConfigurator.configure(GroovyProjectConfigurator.java:49) at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:125) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$6(ProjectConfigurationManager.java:475) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:350) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:262) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:469) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$4(ProjectConfigurationManager.java:413) at java.base/java.util.Collection.removeIf(Collection.java:576) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:407) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$3(ProjectConfigurationManager.java:339) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:350) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:262) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:205) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1093) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:338) 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)

davidmichaelkarr avatar Sep 20 '22 20:09 davidmichaelkarr

Looks like m2e went wild with Java 17 in 2.0:

https://stackoverflow.com/questions/73757713/eclipse-2022-09-maven-update-failure

https://github.com/eclipse-m2e/m2e-core/blob/master/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ProjectConfigurationRequest.java

eric-milles avatar Sep 20 '22 21:09 eric-milles

I backed up to 2022-06 and it's fine now. I'll watch for news here.

davidmichaelkarr avatar Sep 20 '22 21:09 davidmichaelkarr

If you want to go with 2022-09, you can get the old m2e release from this update site: https://download.eclipse.org/technology/m2e/releases/1.20.1

eric-milles avatar Sep 20 '22 21:09 eric-milles

https://github.com/eclipse-m2e/m2e-core/issues/918

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.

eric-milles avatar Oct 07 '22 15:10 eric-milles