I don't understand what the Maven support is doing.

I've been fighting with this for a bit and had to give up and work around it. My work around involves having three separate projects open and I hate it, so I'd like to get this working the way I thought it was supposed to.

Here's what I've been doing, can someone explain to me what IDEA is doing and why?

1) Create project from scratch (with no modules at all)

2) Add a module using "Import module from external model".
  a) Choose Maven
  b) Enter a valid path to a Maven 2 project

* Note: Up to this point everything is great. I have my project, it has one module based on my Maven project. Awesome.

3) File -> New Module and choose "Import module from external module" again.
  a) Choose Maven
  b) Browse to another separate Maven project.
  c) It finds recognizes the pom and offers up the import fine.

Here's where it goes off the tracks.

At this point IDEA kicks the first Maven module out of "the maven structure" and asks me if I want to remove the module from the project too. (See screenshot) I can choose "No" which leaves the module in my project, but it seems to have been detached from Maven which leaves all the dependencies broken.

I don't understand why IDEA won't let me add two Maven modules to one project without freaking out. I imagine this has to work and just doesn't work the way I'm thinking it does. Anyone have a suggestion?

Picture 1.png
Comment actions Permalink

I went through another round of trying to figure out a way around this nonsense last night. Total failure.

I still can't have multiple maven modules in a single project.

Comment actions Permalink

What you are trying to do is to add multiple Maven projects to the same IDEA project. Probably this isn't supported. Instead you could try to create a parent POM for your Maven projects and then open the parent POM.


Please sign in to leave a comment.