Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse m2e - No Such File or Directory in pom.xml

I'm using Eclipse 4.5.2 (Mars.2 JEE), Eclipse Maven m2e v1.7.0 (20160603-1933) plugin, Java 8 multi-module project on Linux RedHat.

My project structure is the following:

  • Parent project containing pom.xml
  • Module A which doesn't depend on any project in Eclipse Workspace. Contains only 3PP dependencies in pom.xml (Guava, Apache Commons, SLF4J...)
  • Module B which contains Module A, and 3PP dependencies (Guava, Apache Commons, SLF4J...).

Structure is:

parent-project
|-- pom.xml // only this file
|
|--module-a
|  |-- pom.xml
|  | code
|
|--module-b
   |-- pom.xml // contains Module A as dependency 

The problem I'm getting (in Eclipse, under "Markers") is:

"Maven Configuration Problem" -> No such file or directory pom.xml /module-b line 1 Maven Configuration Problem

Since I didn't have any issue reported in module-a, I've removed module-a from the module-b dependencies and the above problem is cleared away.

This led me to: It seems that the m2e gets confused when it comes to resolution of one workspace project as other other project dependency. Now, the code is working perfectly well in runtime, but I would like to get rid of this annoyance.

What I've tried:

  • I've tried Eclipse installing Maven plugin v1.6.2 in fresh eclipse installation (deleted eclipse and workspace directories before... lost some time reinstalling) - no luck.
  • I've tried to use Eclipse v4.6.2 (Neon.2) and the same issue appears (before, I've deleted eclipse and workspace directories and created new ones... again, spent some time).
  • Stackoverflow suggestion: Disable workspace resolution in individual project settings. I find this unacceptable since I need to lose time installing all dependent projects in order for the "module-b" look-alike project to work cleanly.
  • Running mvn clean eclipse:clean, eclipse restart + Maven update - no help.

Has anyone found similar issues? Any suggestions?

like image 635
xanmcgregor Avatar asked Oct 17 '22 16:10

xanmcgregor


1 Answers

For me the root cause of this was this bug. If you are in an environment where your temporary directory is shared (e.g. /tmp on Linux), and two or more different users happen to open Eclipse and use M2E to build, then the error occurs. Somewhere in M2E it writes to /tmp/fakerepo, so whichever user gets to write here first gets to own the folder and breaks Eclipse for any other users.

A reboot will often fix the problem (/tmp gets cleared), or simply remove this temporary folder yourself as an administrator before starting Eclipse.

like image 109
Brett Smith Avatar answered Oct 27 '22 09:10

Brett Smith