Best Practicies for Multi-Module Maven Projects?

I am new to IntelliJ (recent convert from Eclipse), and I am wondering the best way to use IntelliJ with my project.  With Eclipse I had all my projects (or modules) open in one instance.  However, through my searches I found conflicting reports on whether to work on each module seperately (in a different intelliJ instance) or just use the "Maven Projects" > "+ Add Maven Project" feature.  There is no parent module so each one stands alone, but obviuosly they are dependant on the other.  I would prefer to have them in one instance since I do modify core quite a bit when working on the front-end modiles.  Can someone help guide me on this one?

"Backend Modules"
afs-mailchimp.pom (custom mass email api)
afs-core.pom (dao, entities, etc)
+ uses: afs-mailchimp

"Front End Modules"
afs-site (Struts)
+ uses: afs-core
afs-mobile (Struts)
+ uses: afs-core
afs-tasks (Java)
+ uses: afs-core

4 comments
Comment actions Permalink

just create a pom-package maven project that materializes your "workspace" (and includes any module you want) and open that one in IDEA

0
Comment actions Permalink

Many thanks for your reply... apologies, but can you provide a bit more clarification?  What specifically should I put in my POM?  For example, currently my afs-site project POM has afs-core project as a "dependency".  Are you implying an additional tag to be placed in the pom or create a "parent" POM?


When I start my intelliJ workspace for the afs-site project, I would also like afs-core project folder structure to load.  Currently only the afs-site project folders are loading automagically.  In addition, each of the modules/projects have it's own SVN "account".  Just making sure that intelliJ would look at these projects seperately while viewing in the same intelliJ instance window.  Not trying to create a hack, just wanting to know the right way to do work with intelliJ and a multi-module maven project.


afs-site pom snippit:

<groupId>com.afs</groupId>
<artifactId>afs-site</artifactId>

<packaging>war</packaging>

<name>AFS Site</name>
<version>3.6</version>
<description>Website Module</description>
...


<dependencies>

     <!-- Include Afs Core -->

     <dependency>
     <groupId>com.afs</groupId>
     <artifactId>afs-core</artifactId>
     <version>3.6</version>
     </dependency>


...

0
Comment actions Permalink

Burton,

you can simply add all you Maven projects with 'Maven Project->Add Maven Project'.
This way you will be able to use cross-project searches, refactorings etc. Compilation will also be performed against the added Maven Projects, so If you change something on server side, it will affect the client side instantly without a need to install artifacts into the repository.

1
Comment actions Permalink

Thanks for your answer.  I sort of stumbled upon that as well - glad to know that is the way to do it!

0

Please sign in to leave a comment.