eclipse-m2e / m2e-core

Eclipse Public License 2.0
113 stars 116 forks source link

java.lang.IllegalArgumentException: Path must include project and resource name: / #1790

Open perceptron8 opened 3 months ago

perceptron8 commented 3 months ago

What steps will reproduce the problem?

  1. git clone https://github.com/google/guava
  2. Import -> Existing Maven Projects*
  3. Maven -> Update project... -> OK

* you may like to use [groupId].[artifactId] as "Name template" to avoid name conflicts

-- Error Details --
Date: Fri Jul 19 09:08:02 CEST 2024
Message: Could not update project com.google.guava.guava configuration
Severity: Error
Product: Eclipse IDE 4.32.0.20240606-0749 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.m2e.core
Session Data:
eclipse.buildId=4.32.0.20240606-1231
java.version=21.0.3
java.vendor=Ubuntu
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product -clean

Exception Stack Trace:
java.lang.IllegalArgumentException: Path must include project and resource name: /
    at org.eclipse.core.runtime.Assert.isLegal(Assert.java:68)
    at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2223)
    at org.eclipse.core.internal.resources.Container.getFolder(Container.java:200)
    at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.getFolder(AbstractJavaProjectConfigurator.java:907)
    at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.addResourceDirs(AbstractJavaProjectConfigurator.java:544)
    at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.addProjectSourceFolders(AbstractJavaProjectConfigurator.java:398)
    at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configure(AbstractJavaProjectConfigurator.java:168)
    at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:127)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$6(ProjectConfigurationManager.java:506)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:458)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:339)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:500)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$4(ProjectConfigurationManager.java:426)
    at java.base/java.util.Collection.removeIf(Collection.java:583)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:414)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$3(ProjectConfigurationManager.java:340)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:458)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:339)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:278)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1053)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:339)
    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)
abuech2s commented 3 months ago

I receive the same error stack.

What are the steps to reproduce the problem?

It seems, that m2e/Eclipse does not accept the root layer ( / ) as a directory anymore. The critical line is therefore at minexample\mymodule1\src\main\java\mymodule1\Module1.java at line 23. Imo, in case you route this <directory> by using .. to the root layer, the error appears.

In case, you use some other directorypath, e.g. <directory>.</directory> (current submodule-dir), eclipse would accept this.

How to build?

Error:

image

Technical details:

Apache Maven 3.9.7 (8b094c9513efc1b9ce2d952b3b9c8eaedaf8cbf0)
Maven home: C:\Users\<Username>\Documents\apache-maven-3.9.7
Java version: 1.8.0_312, vendor: Temurin, runtime: C:\Program Files\Eclipse Adoptium\jdk-8.0.312.7-hotspot\jre

Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
eclipse.buildId=4.32.0.20240606-1231
java.version=22.0.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

image

minexample.zip

abuech2s commented 3 months ago

Is there any timeslot/plan from the development-team here to fix this problem?

laeubi commented 3 months ago

There is no "development team" only some people working on their free time, if you can reproduce and like to provide a fix contributions are welcome.

If this is crucial to someones business and likes to speed up the development in that area a sponsoring would allow me to assign more time-slots or contact me directly for contracted work to fix a particular issue.

abuech2s commented 3 months ago

I appreciate spending the free time for such a project. So, I already was able to reproduce it, and prepared the minimal example - hope this example helped to show the developer, what went wrong.