Bug 1704981 - Eclipse cannot import maven projects
Summary: Eclipse cannot import maven projects
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: eclipse-m2e-core
Version: 30
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Mat Booth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-30 23:44 UTC by Pavel Roskin
Modified: 2020-08-25 13:03 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 14:37:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Roskin 2019-04-30 23:44:57 UTC
Description of problem:

After updating to Fedora 30, Eclipse fails to import maven based projects

Version-Release number of selected component (if applicable):

eclipse-jdt-4.11-4.fc30.noarch
eclipse-m2e-core-1.11.0-1.fc30.noarch

How reproducible:

Always

Steps to Reproduce:
1. Run Eclipse
2. File->Import->Maven->Checkout Maven Projects from SCM
3. Enter https://github.com/jenkinsci/stash-pullrequest-builder-plugin.git and click "Finish

Actual results:

A message appears:

An internal error occurred during: "Importing Maven projects".
org.apache.lucene.document.Field.<init>(Ljava/lang/String;Ljava/lang/String;Lorg/apache/lucene/index/IndexableFieldType;)V

Expected results:

The project is imported successfully

Additional info:

Also tested with https://github.com/jenkinsci/stashnotifier-plugin.git

Message from ~/workspace/.metadata/.log:

!ENTRY org.eclipse.core.jobs 4 2 2019-04-30 16:42:11.456
!MESSAGE An internal error occurred during: "Importing Maven projects".
!STACK 0
java.lang.NoSuchMethodError: org.apache.lucene.document.Field.<init>(Ljava/lang/String;Ljava/lang/String;Lorg/apache/lucene/index/IndexableFieldType;)V
        at org.apache.maven.index.IndexerField.toField(IndexerField.java:96)
        at org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator.updateDocument(MinimalArtifactInfoIndexCreator.java:267)
        at org.apache.maven.index.ArtifactContext.createDocument(ArtifactContext.java:195)
        at org.apache.maven.index.DefaultIndexerEngine.update(DefaultIndexerEngine.java:72)
        at org.apache.maven.index.DefaultIndexer.addArtifactsToIndex(DefaultIndexer.java:109)
        at org.apache.maven.index.DefaultNexusIndexer.addArtifactToIndex(DefaultNexusIndexer.java:337)
        at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.addDocument(NexusIndexManager.java:588)
        at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.mavenProjectChanged(NexusIndexManager.java:767)
        at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:777)
        at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:921)
        at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:298)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:259)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:175)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:1)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
        at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1336)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:143)
        at org.eclipse.m2e.core.ui.internal.wizards.ImportMavenProjectsJob$1.doCreateMavenProjects(ImportMavenProjectsJob.java:68)
        at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:73)
        at org.eclipse.m2e.core.ui.internal.wizards.ImportMavenProjectsJob.runInWorkspace(ImportMavenProjectsJob.java:77)
        at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Comment 1 Pavel Roskin 2019-05-01 17:58:35 UTC
I uninstalled the packaged Eclipse and installed the same version 2019-03 using a tarball from eclipse.org. Eclipse is working properly with Maven projects now. So it must be a packaging issue.

From the About dialog:

Version: 2019-03 (4.11.0)
Build id: 20190314-1200

Comment 2 Michael 2019-05-02 15:26:40 UTC
For me the maven integration is broken as well. I'm getting:

[Worker-7: Updating Maven Dependencies] ERROR org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob - Could not lookup required component
org.eclipse.core.runtime.CoreException: Could not lookup required component
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.lookup(MavenImpl.java:1253)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.detachFromSession(MavenImpl.java:653)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:916)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob$1.call(ProjectRegistryRefreshJob.java:98)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob$1.call(ProjectRegistryRefreshJob.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1336)
	at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:81)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
      role: org.eclipse.m2e.core.internal.embedder.ContextRepositorySystemSession
  roleHint: 
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.lookup(MavenImpl.java:1251)
	... 10 more
Caused by: java.util.NoSuchElementException
	at org.eclipse.sisu.inject.LocatedBeans$Itr.next(LocatedBeans.java:141)
	at org.eclipse.sisu.inject.LocatedBeans$Itr.next(LocatedBeans.java:76)
	at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:76)
	at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:56)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
	... 13 more

Comment 3 Michael 2019-05-02 19:21:23 UTC
Yes, happens with an random maven project:

Could not lookup required component
java.util.NoSuchElementException
      role: org.eclipse.m2e.core.internal.embedder.ContextRepositorySystemSession
  roleHint:

Comment 4 Michael 2019-05-08 09:59:38 UTC
Are there any news here?
Currently the eclipse maven integration is completely broken and unusable...

Comment 5 Kyle Marek 2019-05-16 23:47:15 UTC
comment 3 happens with importing "Existing Maven Projects".

Such can be made with:

mvn archetype:generate -DgroupId=test -DartifactId=test -DinteractiveMode=false

Comment 6 Thilo Bangert 2019-06-24 12:02:24 UTC
i have similar but seemingly related error:

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'XXX'.
Could not lookup required component
java.util.NoSuchElementException
      role: org.eclipse.m2e.core.internal.embedder.ContextRepositorySystemSession
  roleHint: 
Could not lookup required component
java.util.NoSuchElementException
      role: org.eclipse.m2e.core.internal.embedder.ContextRepositorySystemSession
  roleHint: 

I upgraded from Fedora 29 and since the upgrade i get the following error everytime eclipse wants to rebuild.
I tried wiping my workspace and start from scratch, but that did not yield any change.

Thanks

Comment 7 Florian Krammel 2019-09-08 17:53:17 UTC
Still the same Problem

- updating indexes fails with the lucene error
- updating maven project fails with could not lookup required component

Did the upgrade from Fedora 29 to 30. The workspace already contained the projects.

Comment 8 Fedora Admin XMLRPC Client 2020-04-06 16:52:16 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 9 Fedora Admin XMLRPC Client 2020-04-27 16:43:38 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 10 Ben Cotton 2020-04-30 20:11:13 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 esnel 2020-05-02 08:31:25 UTC
This bug (or a similar one) is still present in F32 (all updates installed today). New stack trace from ~/workspace/.metadata/.log:

!ENTRY org.eclipse.osgi 4 0 2020-04-30 10:39:39.922
!MESSAGE An error occurred while automatically activating bundle org.eclipse.m2e.core (279).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.m2e.core.internal.MavenPluginActivator.start() of bundle org.eclipse.m2e.core.
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:863)
        ...
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/shared/artifact/resolve/ArtifactResolverException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        ...
Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.artifact.resolve.ArtifactResolverException cannot be found by org.eclipse.m2e.archetype.common_1.15.0.20200401-2126
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
        ...
Root exception:
java.lang.NoClassDefFoundError: org/apache/maven/shared/artifact/resolve/ArtifactResolverException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        ...
Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.artifact.resolve.ArtifactResolverException cannot be found by org.eclipse.m2e.archetype.common_1.15.0.20200401-2126
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
        ...

Analysis:
 * The class actually *IS* available, but in a different package, i.e. "org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException"
 * It seems to be caused by using incompatible versions of "archetype-common" and "maven-artifact-transfer"
 * It seems to be resolved in "maven-artifact-transfer" version "3.1.2"
 * Manually changing the symbolic link "archetype-common-3.1.1.jar" in "/usr/share/eclipse/droplets/m2e-core/plugins/org.eclipse.m2e.archetype.common_1.15.0.20200401-2126/jars" to point to version "3.1.2" of this Maven component resolved this issue for me.

Proposed solution:
 * Update "maven-archetype-common" from "3.1.1" to "3.1.2"

Comment 12 Ben Cotton 2020-05-26 14:37:23 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 13 Maciej Sitarz 2020-08-25 13:03:15 UTC
I encountered this problem on Fedora 32 with the following packages installed:
# rpm -qa|grep -E '(eclipse|m2e)' | sort
eclipse-ecf-core-3.14.7-1.module_f32+8422+d2b9781b.noarch
eclipse-emf-core-2.21.0-1.module_f32+8422+d2b9781b.noarch
eclipse-emf-runtime-2.21.0-1.module_f32+8422+d2b9781b.noarch
eclipse-emf-xsd-2.21.0-1.module_f32+8422+d2b9781b.noarch
eclipse-equinox-osgi-4.15-5.module_f32+8555+6b76193d.x86_64
eclipse-gef-3.11.0-12.module_f32+8422+d2b9781b.noarch
eclipse-jdt-4.15-5.module_f32+8555+6b76193d.noarch
eclipse-m2e-core-1.15.0-3.module_f32+8482+8510b2e7.noarch
eclipse-m2e-core-javadoc-1.15.0-3.module_f32+8482+8510b2e7.noarch
eclipse-m2e-workspace-0.4.0-14.module_f32+8422+d2b9781b.noarch
eclipse-m2e-workspace-javadoc-0.4.0-14.module_f32+8422+d2b9781b.noarch
eclipse-p2-discovery-4.15-5.module_f32+8555+6b76193d.noarch
eclipse-platform-4.15-5.module_f32+8555+6b76193d.x86_64
eclipse-swt-4.15-5.module_f32+8555+6b76193d.x86_64
eclipse-usage-4.13.0-1.module_f32+8422+d2b9781b.noarch
eclipse-webtools-common-3.15.0-4.module_f32+8422+d2b9781b.noarch
eclipse-webtools-servertools-3.15.0-4.module_f32+8422+d2b9781b.noarch
eclipse-webtools-sourceediting-3.15.0-4.module_f32+8422+d2b9781b.noarch


I was able to fix it following @esnel tips.
I used a command:
wget -O /usr/share/java/maven-archetype/archetype-common.jar https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-common/3.1.2/archetype-common-3.1.2.jar


Please reopen this bug report.


Note You need to log in before you can comment on or make changes to this bug.