Sachin
Sachin

Reputation: 267

Combine multiple maven projects into single in Eclipse

I have one maven project with pom.xml.
This project refers another 2 projects.
These 2 projects have their own pom.xml in their respective folders.
So when I build base pom.xml other 2 projects also get built.

Now here is what I did

a) Build base project (This built 2 subprojects as well).
b) Used mvn eclipse:eclipse to export base project.
c) Imported base project into eclipse using Eclipse menu File-> Import existing Maven project.

After importing it created 3 different projects in Eclipse. As methods for 3 projects get called from each other it gives many errors. What I want is after importing it should create single project and all the code will be in a single project.

Is there any way to do this?

Upvotes: 1

Views: 2856

Answers (2)

blakery
blakery

Reputation: 71

You could make a multi-module project. This will allow you to define a top-level project and the structure of it's dependencies. It will likely still require some refactoring, but it should be relatively modest.

Maven website: Guide to Working with Multiple Modules

A third party guide

Upvotes: 1

Sundararaj Govindasamy
Sundararaj Govindasamy

Reputation: 8495

Simple answer is NO.

Unless you manually merge/refactor these 3 projects into one.

pom.xml is per project, here there are 3 poms.

Upvotes: 0

Related Questions