[8.01] multiple project frames and local maven snapshots

Hi guys,

Has anyone found a productive way to work with multiple open project frames and maven snapshots in large projects?

My common case is that in one project I'll use maven to install a snapshot to the local repository, and in another project frame commence using that snapshot immediately (jar + source artifacts).

In IntelliJ IDEA I know of two ways to work like this:
- the default is allow intellij to detect changes automatically on frame activation.  A modal dialog "updating modified files"  appears and blocks input in both frames while intellij does its work.
If maven touched a large number of files visible to IntelliJ, this can take a significant amount of time;  or
- disable automatic detection of changed files and instead manually instruct the maven plugin to reimport projects. This pops up a model dialog for a shorter time followed by a long-running background task.  It also resets some settings back to values derived from the pom.  In this case IntelliJ does much more work than necessary.

There's been massive improvements to maven integration since 7.03+, and especially in 8.01, but I'm still not "developing with pleasure" in this area.

Can anyone suggest a better way to work?

I suspect if I prevent intellij from seeing any of the files touched by maven, except the local repository, I'd getter better performance.  However when the project settings are derived from the maven pom it seems there will always be some overlap, especially if both projects are open in IntelliJ.

Thanks,
Jeromy Evans



6 comments
Comment actions Permalink

Are you working with subversion?  If so, I set up svn:externals to point to the various modules I work on, and create a parent "builder-pom" that references each of those projects in its  <modules> element.  For example, if I have 2 maven modules with this subversion layout (with a pom.xml existing in each):

svn://projects/library/trunk/
svn://projects/application/trunk

I create a new subversion module (no reason to have trunk/branch directories):

svn://projects/builder/

I set up the svn:externals on that builder to be as such:

library svn://projects/library/trunk/
application svn://projects/application/trunk

Then in the root of builder I have a small pom file with this modules stanza:

...
<modules>
    <module>library</module>
    <module>application</module>

</modules>
...

This removes the need to have a frame-per-module.   You do end up with a pretty large mega-project though!

I'm not sure if that's what you're after, but i hope it helps.

~ kc

0
Comment actions Permalink

Thanks Keith, that's a good suggestion. It would minimize my need to install snapshots.
In the past I encountered performance issues with "mega projects" but 8.01 may handle it.

0
Comment actions Permalink

Hi!

I have similar problem working with maven (running 8.0.1).

We have a structur lookling like this


root/project1/1sub1
                  /1sub2
                  /1sub3
     /project2/2sub1
                 /2sub2
                 /2sub3
    /project3/3sub2
                /3sub2
                /3sub3

Each project has it's own pom-file listing all it's sub projects as modules. Each sub module possibly depends on the artifacts created from other sub modules in the other projects and also several other projects that I'm not working on. Building this with maven command line works very well.

Now to my problem. Running "mvn idea:idea" in each of the project directors will give me .iml-files that I can import into an emtpy project and by doing so I can edit any project I need and compile it using normal maven commands outside IDEA.

My dream is (and I really though IDEA 8 would give me this) that I would be able to simply open all the pom-files from all relevant projects and get the same thing (ie all sub projects opened as modules).

I'm a doing it wrong or isn't this supported?

Thanks.

0
Comment actions Permalink

Hi, Andreas,

Have you tried opening the root project with built-in Maven Integration plug-in? You can use eigher 'Open Project' and pointing it to the root/pom/xml or using 'New Project->Import from external structure' functionality.

Thanks,
Anton Makeev

0
Comment actions Permalink

Hi!

I have testad that but it doesn't work very well. The 3 projects in my example is really just a subset of all projects. There are some 50 projects of which I work with 3 o 4. Having all of them will make IDEA too slow.

This brings a second point to this thread... It's been discussed in http://www.jetbrains.net/jira/browse/IDEADEV-26269 about disabling modules... As far as I know that isn't possible yet (no, the offline-module plugin doesn't do the trick). If it where possible to disable modules this solution would work great

0
Comment actions Permalink

If I've understood correctly, Andreas' situation isn't solved by opening a parent pom or uber-pom. 

He's worked-around my issue by directly importing individual modules from multiple projects (sub-poms) into one parent intelliJ project.  That allows him to edit, refactor and commit across multiple maven projects within a single frame, at the cost of losing synchronization with the source pom's.  It avoids the multiple-frames problem I faced.

I prefer the previously suggested approach of creating a maven project with externals but imagine that may have disadvantages when so many projects are involved.

regards,
Jeromy Evans

0

Please sign in to leave a comment.