Reputation: 905
I am having trouble with m2eclipse.
I am using Eclipse 3.6.2, m2eclipse 0.12.1 and m2extras for subclipse 0.12.0 and for wtp 0.11.1.
I have projects A(jar packaging), B(jar) and C(war). I have all three in my workspace and NOT in local or remote repo (double checked). C has dependencies on A and B. A has dependencies on some libraries (say X and Y) and B has dependencies on some other libraries (say P, Q and R). C has too dependencies on external libraries (say U, V, W). What Eclipse is showing to me in "Maven Dependecies" is following:
A
- Maven Dependencies
+ (jar icon) X
+ (jar icon) Y
B
- Maven Dependencies
+ (jar icon) P
+ (jar icon) Q
+ (jar icon) R
C
- Maven Dependencies
+ (jar icon) U
+ (jar icon) V
+ (jar icon) W
+ (jar icon) X
+ (jar icon) Y
+ (jar icon) P
+ (jar icon) Q
+ (jar icon) R
This is a problem because in project C Eclipse is not aware of the code in projects A and B. I expect the project setup for C to look like this
C
- Maven Dependencies
+ (jar icon) U
+ (jar icon) V
+ (jar icon) W
+ (jar icon) X
+ (jar icon) Y
+ (jar icon) P
+ (jar icon) Q
+ (jar icon) R
+ (folder icon) A
+ (folder icon) B
What is the worst thing is that until I recently updated the project with the latest code from SVN the project setup for C looked like it should, and now it does not. And I remember having this problem earlier, but I cannot remember how I solved it.
I have yet another project - D with jar packaging, and it's showing like this in project explorer:
D
- Maven Depenedencies
+ (jar icon) X
+ (jar icon) Y
+ (jar icon) I
+ (jar icon) J
+ (folder icon) A
What is the remedy for this situation? I cannot remember what I have done previous time. Maybe I have installed Eclipse from scratch?
Upvotes: 3
Views: 2042
Reputation: 21
I had the same problem. I wanted my related projects to appear under Maven Dependencies with blue folder icons, rather than jar icons, indicating that the projects were referencing each other in Eclipse, and not just linking to their jars from my local Maven repository.
I resolved the problem by opening the POM in Eclipse, reordering the dependencies, and saving. M2Eclipse reprocessed the dependencies and fixed everything. I'm not sure why it worked, but it did.
Prior to this action, I also deleted the Eclipses projects' repo folders where the undesirable JARs were coming from. Things still weren't working afterwards, so I don't know if that had anything to do with why the fix mentioned above worked.
Upvotes: 2
Reputation: 905
Well, I have deleted my workspace, checked in projects again and now the set up for project A is showing up like this:
C
- Maven Dependencies
+ (jar icon) U
+ (jar icon) V
+ (jar icon) W
+ (jar icon) X
+ (jar icon) Y
+ (jar icon) P
+ (jar icon) Q
+ (jar icon) R
- Web App Libraries
+ (jar icon) R
+ (jar icon) V
+ (jar icon) X
+ (jar icon) W
+ (jar icon) Y
+ (jar icon) P
+ (jar icon) U
+ (jar icon) Q
+ (folder icon) A
+ (folder icon) B
It looks like that dependent projects are now shown in Web App Libraries. I believe that it is possible that "Dynamic Web Module" facet was not present earlier when I checked in new code from SVN which possibly triggered Maven > Update Project Configuration.
Also now I use version 0.12.0 version of m2extras for wtp.
Upvotes: 0
Reputation: 2199
I had the same problem. Someone in the team checked in following configuration files:
.settings/org.eclipse.wst.common.component
.settings/org.eclipse.wst.common.project.facet.core.xml
.settings/org.eclipse.wst.jsdt.ui.superType.container
.settings/org.eclipse.wst.jsdt.ui.superType.name
After I deleted them m2eclipse could setup the projects correctly.
Upvotes: 2