maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Franklin <>
Subject Re: Import Submodule into Maven Project in IntelliJ
Date Sun, 20 Mar 2016 16:52:34 GMT
I decided to just go with the inelegant solution of building a new
project and adding submodules into which I clicked and dragged the
source code I needed. So the problem is solved.

It looks like this in IDEA now: 

-- parent
    -- sub-module 1
    -- sub-module 2
    -- etc.

Perhaps I'm not using Maven in the spirit it was intended... I noticed
in the POM reference that you can declare a parent project and, in the
<module /> element, specify its aggregated projects with a relative
pathname (meaning the modules don't need to be  subdirectories of the
parent). Similarly, I saw that an inheriting pom.xml can use relative
pathnames in its <parent /> element.  

So, it is possible to "relate" projects strongly without unifying them
into a directory hierarchy of IDEA project files. Then, the user can
import multiple projects that are then shown as a list in the project
explorer. I was hoping that the IDEA Maven plugin would unify all of my
projects for me when I declared the relationship. However, given the
observation in the previous paragraph, there must be situations in which
this behavior is undesirable. And, there are probably very few
situations where this is really required given Maven's ability to relate
projects with such flexibility. 

Maven by Example makes it seem as though the directory hierarchy for
parent/submodule projects is highly desirable (if not required). 

Correct analysis?  

  Jason Franklin

On Sun, Mar 20, 2016, at 07:00 AM, Jason van Zyl wrote:
> I generally use Eclipse but I believe what you want is what’s referred to
> a workspace in Eclipse. A graph of loosely related projects in the
> workspace where you resolve against the version in your workspace as
> opposed to resolving the dependency from the repository system. If I
> recall there is a “+” button hidden in the Maven view that allows you to
> add more Maven projects to a single workspace so that you don’t have to
> make aggregrator POMs or have multiple windows open. I remember it being
> extremely hard to find. If you can’t see it I’ll fire up IDEA and try to
> put together an example.
> > On Mar 17, 2016, at 11:50 AM, Jason Franklin <> wrote:
> > 
> > Greetings, 
> > 
> > I'm new to Maven, and I've taken the time over the past week to read
> > "Maven by Example." I'm trying to join two independent projects as
> > submodules in a third project serving as the parent project. Is there a
> > way to create a parent project in IntelliJ and import two previously
> > independent projects as submodules without simply moving the directories
> > and changing the pom.xml files manually? 
> > 
> > -- 
> >  Jason Franklin
> >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > For additional commands, e-mail:
> > 
> Thanks,
> Jason
> ----------------------------------------------------------
> Jason van Zyl
> Founder, Takari and Apache Maven
> ---------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message