Import Multiple Maven Poms

Answered

Hi guys,

 

I have a maven project with muliple poms (pom.xml). The is one reactor pom called proj-parent and a number of modules that build from it. If I open proj-parent, IntelliJ imports all the modules as well. So good so far.

 

But there are other maven poms which are part of the project but are not modules of proj-parent (because they aren't built together). I'd still like to have them be part of the same IntelliJ project (for various reasons) but every time I open a pom.xml, I can either open it as a project (which puts it in it's own IJ project) or as a file (which just lets me view the xml).

 

What should I do?

 

Thanks much!

4 comments
Comment actions Permalink

Hello,

Do you have "Search for projects recursively" option enabled when you import pom.xml ?

0
Comment actions Permalink

I'm using File->Open and I don't see that option. I don't find any import menu anywhere.

0
Comment actions Permalink

John,

I tried to recreate your case. So I have root project, submodule (webmod) and another project under root (webmodNOT):

After importing root pom.xml IDEA properly detects "webmod" as submodule. Now it's possible to press "+" in maven tool window and select pom.xml from "webmodNOT" folder and it'll be added as project.

The same you could archive if you select "Import project" from welcome screen, select root pom.xml and enable "Search for projects recursively" option.

 

 

0
Comment actions Permalink

Perfect! Works for me too. Thank you!

0

Please sign in to leave a comment.