Yesterday night I had spent an hour or so tracking down a bug that has been bothering me for a while. The effect of this bug is that projects created with the m2eclipse plugin seem to be missing some important metadata required by the WTP plugins. As a result references to other projects (in workspace) do not show up as JavaEE (J2EE) module dependencies or sometimes even the project properties dialog for JavaEE module dependencies only shows an error. I had analysed this bug a while ago already but never documented this, some more investigation is still required to figure out what causes this missing metadata and report it to the m2eclipse developers.
Anyway here is how to fix it. Let’s say we have a web project A and a utility project B. You face the situation that project B does not show up as JavaEE module dependency. Open B in the navigator view (so you can see all the metadata files .project, .settings/… etc.). Look for a file .settings/org.eclipse.wst.common.component! Does it exist? If no just create it, its contents should be like
1 2 3 4 5 6 7
Next check the .project file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
In my case the file was missing some builders (should not be relevant for the bug)
and some natures (these really hurt)