0

My project has the following structure:

/ProjectRoot
/ProjectRoot/A
/ProjectRoot/B
/ProjectRoot/C

ProjectRoot is a multimodule project. Project A should create war and it has dependencies to projects B and C delared in its pom. When I run maven eclipse:eclipse on ProjectRoot it results in incorrect .classpath file created for project A.

<classpath>
  <classpathentry kind="src" path="/B"/>
  <classpathentry kind="src" path="/C"/>
</classpath>

This stops the build in eclipse. Problems tabs displays:

Project 'A' is missing required Java project: 'B'
Project 'A' is missing required Java project: 'C'
The project cannot be built until build path errors are resolved

I know I can fix this problem manually(Properties/Build path/Projects remove the missing ones and then add them once again) but I would like to have the correct settings generated automatically by maven-eclipse-plugin.

Edit: The problem might have something to do with the fact that directory names and artifactIds of the submodules are not equal, i.e. project that is stored in directory B has artifactId "B-Big-Project"

Tomasz W
  • 2,263
  • 1
  • 17
  • 22
  • Does you build work correctly on command line? – khmarbaise May 11 '15 at 12:31
  • Yes, maven build(install) works fine. – Tomasz W May 11 '15 at 12:37
  • 1
    Maybe this can help. Sometime Eclipse needs a little help :) https://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html – aviad May 11 '15 at 12:38
  • Thanks. I have seen this article before I posted this question but I haven't tried it. Now I have done that and it turned out to work fine for me. Sadly, that means that the example provided by me is not verifiable. If I find the root cause, I will update it. – Tomasz W May 11 '15 at 13:39
  • BTW: You should use m2e only so importing in Eclipse should work without any problems. – khmarbaise May 11 '15 at 13:52

0 Answers0