1

I have multi module java project as follows:

top_level_project pom.xml (...) <groupId>a.b.c</groupId> <artifactId>myProject</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>module1</module> <module>module2</module> </modules> /module1 pom.xml (...) <parent> <artifactId>myProject</artifactId> <groupId>a.b.c</groupId> <version>1.0-SNAPSHOT</version> </parent> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </dependency> </dependencies> /src/main/java .project /module2 pom.xml (...) <parent> <artifactId>myProject</artifactId> <groupId>a.b.c</groupId> <version>1.0-SNAPSHOT</version> </parent> /src/main/java .project 

I used Eclipse Kepler & Luna.

Issue is slf4j dependency added in module1 is not recognized by eclipse(this is true for all dependencies). I checked Parent project -> Java Build Path -> Library where Maven dependency cannot be seen or added.

Also, right clicking module1 -> Properties, I don't have option of Java build path.

Parent project -> Java Build Path -> Source tab: I see folders listed as top_level_project/module1/src/main/java. I left default output folder at top_level_project/bin.

Project facet is Java 1.7.

Executing maven goals works just fine.

Any help would be appreciated.

2
  • Does the project have Maven nature (little M in the top left corner of project icon)? Did you try <right-click-menu>->Maven->Update Project? Commented Sep 17, 2014 at 18:29
  • Yes ( I included this info in edit but can't see it) Commented Sep 17, 2014 at 18:47

1 Answer 1

1

I found solution to this. Click on top_level_project. From menu, select File -> Import -> Maven -> Existing Maven Projects. Select module1 etc. and click OK.

What this does is add sub project in workspace at same level as top_level_project. I expect it to remain under top_level_project since module1 is sub project, but this solution works as module1 is recognized as Maven project and all Maven dependencies are included.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.