Search code examples
eclipsemavenm2eclipsedependency-managementeclipse-wtp

m2eclipse does not show workspace project dependencies but shows transitive dependencies


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?


Solution

  • 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.