39 Replies Last post: Sep 16, 2009 7:43 PM by Thibaut  
Peter Niederwieser Novice 94 posts since
Sep 28, 2007
Currently Being Moderated

Oct 20, 2008 9:20 PM

Maven integration unusable for larger projects

We are facing the situation that IDEA's Maven integration is virtually unusable for larger Maven projects (say 50-100 modules). Some of our problems are:

 

- Opening the project takes about 30 minutes and most of the time involves re-indexing of all files, including JDK classes (by comparison, "mvn eclipse:clean eclipse:eclipse" takes about a minute)

- Very often IDEA becomes totally unresponsive and hangs forever when the project is opened

- After running a Maven build from the command-line, IDEA indexes all files produced by the build, again causing a loss of time for the developer

 

Although the extremely poor performance makes me wonder whether IDEA's approach of integrating with Maven is fundamentally wrong, I do understand that such criticism isn't very helpful. Therefore I'd like to propose some features that might improve our situation:

- Allow actions (e.g. re-import) on individual modules rather than the whole project only

- Allow full control over which modules are built by IDEA, and which are taken from the Maven repository, with the ability to rapidly change this "working set"

- Offer a more lightweight Maven integration, similar to eclipse:eclipse and the former idea:idea

 

I'm a big fan of IDEA and try to promote it where I can, but unless Maven integration improves soon, our team will have to abandon IDEA and go back to Eclipse. Please help!

 

Cheers,

Peter

 

PS: We are currently using Diana EAP build 8890, but have had similar issues with IDEA 7.

Trevor  Novice 231 posts since
Aug 21, 2002
Currently Being Moderated
Oct 20, 2008 10:17 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

we also have the same issue.  i hope jetbrains clears up these performance issues surrounding maven integration and re-indexing files.  if idea was developed using maven, the jetbrains developers would have hit this and fixed the perf issues eons ago.  you don't hit these issues with a tiny 5 module project.

 

a few outspoken members of our team are using these performance issues as a reason to move to eclipse.  when you spend more time waiting for intellij than coding, development is not a pleasure.

 

i agree with the prior post that the maven sync can be made a lot more intelligent and only update the module that has changed.  frequent freezes (with idea taking exactly 50% of my dual-core cpu) has made me move back to build 7962 (selena)

 

-Trevor

Erik Pragt Apprentice 677 posts since
Oct 26, 2004
Currently Being Moderated
Oct 20, 2008 11:57 PM in response to: Trevor
Re: Maven integration unusable for larger projects

I agree with the above. We only have a couple of small projects linked together to around 30 modules, and the parsing of the poms is slow. This cannot be done in the background, which makes it worse. The dependency resolution is can however be done in the background, which is great, but it would be better to only reimport the changed modules, thus saving a lot of time.

 

Another issue I encounter is the lack of feedback.  If a typo was made in the dependencies (for example, a wrong version number), an 'empty' dependency is added to the project, instead of an error message or something. That would also be a very nice enhancement, cause now, I have to run every maven target manually first, to see if my dependencies are correct....

M. J. Milicevic Apprentice 678 posts since
Aug 22, 2002
Currently Being Moderated
Oct 21, 2008 1:39 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

same feelings here. Maven itself is painfully slow and can be major PITA, adding intellij reparsing/reloading stuff, it becomes totally unusable. Now, I also cannot see myself moving to Eclipse or Netbeans, but there were moments I had those bad thoughts..Lets hope this gets fixed.

Brandon Enochs Newbie 20 posts since
Aug 31, 2004
Currently Being Moderated
Oct 22, 2008 6:26 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

I completely agree.  Maven performance is terrible in 8.0 EAP

Guest
Currently Being Moderated
Oct 23, 2008 6:18 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

Same problem.

 

One way to increase performance is to uncheck the Maven Integration 

setting "Automatically generate sources and update folders on import".

When I need to update folders (not very often), I manually click the 

"Update folders" icon in the Maven panel instead.

 

 

What would be great is to have a button "Re-import only this pom.xml" in 

addition to "Re-import" for the "The pom.xml has been changed." promt (the 

yellow promt at the top of the editor). The most common use case is that I 

have added a dependency, and it shouldn't take me 5-10 minutes to be able 

to use that dependency.

 

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Oct 24, 2008 5:16 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

Hi,

Could anyone take a CPU snapshot during opening/re-importing and send it to Anton.Makeev@jetbrains.com?

 

Thanks,

Anton Makeev

Aaron Cohen Newbie 28 posts since
Sep 26, 2005
Currently Being Moderated
Oct 27, 2008 6:00 PM in response to: Anton Makeev
Re: Maven integration unusable for larger projects

Do you know where my "create CPU snapshot" button has gone?  It no longer appears on the toolbar as of several EAPs.  This is on Linux (Fedora 9).

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Oct 29, 2008 5:22 PM in response to: Aaron Cohen
Re: Maven integration unusable for larger projects

Please check if yout idea.properties file has "-agentlib:yjpagent" line and there is "yjpagent.dll" file in your idea.home/bin directory.

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Oct 30, 2008 2:35 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

According to several snapshots I've got, the main problem is with connection to the remote repository. The central repository (repo1.maven.org) is very slow, so please consider using a public mirror, or creating a local repository mirror (using the Nexus manager nexus.sonatype.org).

 

Thanks,

Anton Makeev

M. J. Milicevic Apprentice 678 posts since
Aug 22, 2002
Currently Being Moderated
Oct 30, 2008 3:13 PM in response to: Anton Makeev
Re: Maven integration unusable for larger projects

Hi Anton,

this may be true, however, to give you an example:

 

1. let say I have a pom with artifactA and artifactB in it.

2. I import this into intellij and everything is ok: sources downloaded and all sits in /home/user/.m2/repo directory

3. now I remove artifactA. What I expect is that Idea is smart enough to just remove libraries/dependencies that belong to that artifact and that it doesn't need to go to http://maven.repo.xxx.com

 

For my part, take whatever it needs to parse re-parse  stuff first time, I will wait.

What happens now is that for every simple change it seems whole pom is reparsed and all dependencies checked again and again.

M. J. Milicevic Apprentice 678 posts since
Aug 22, 2002
Currently Being Moderated
Oct 30, 2008 3:14 PM in response to: M. J. Milicevic
Re: Maven integration unusable for larger projects

btw, we run archiva here but it's still just to slow..

(http://archiva.apache.org/)

Trevor  Novice 231 posts since
Aug 21, 2002
Currently Being Moderated
Oct 31, 2008 1:37 AM in response to: M. J. Milicevic
Re: Maven integration unusable for larger projects

if you add something like this to your settings.xml, you can proxy all request through yuor local maven repository (artifactory, archive, etc).  set up your repo to reach out to the outside world if it is not already cached in your repo.  Therefore, you rarely will go out to the internet, you'll stay on yuor intranet.

 

i'm pretty happy with the maven speed right now in v8, although we can still optimize to only update the module whose pom has changed.

 

 

Yann Cébron IDEA Plugin Contest Winner 1,265 posts since
Aug 22, 2002
Currently Being Moderated
Oct 30, 2008 3:22 PM in response to: Anton Makeev
Re: Maven integration unusable for larger projects

For me, downloading artifacts got significantly faster in the latest builds - thanks. I even notice the difference in speed using Nexus. Would it be possible to download multiple artifacts at once if the remote repository is recognized to be a local one? This could speed up things possibly even more.

constv  Novice 138 posts since
Nov 8, 2002
Currently Being Moderated
Oct 30, 2008 3:24 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

The Maven performance needs improvements, I agree. However, honest to God, if your project has 50-100 modules(!), and they are all coupled in the way that you can't separate them into separate projects where each project uses most dependencies as jars (while other developers are working on later versions), then you have much bigger problems to worry about then Idea's performance... Something must be terribly wrong with your package structure and dependencies if you can't split things up.

constv  Novice 138 posts since
Nov 8, 2002
Currently Being Moderated
Oct 31, 2008 12:02 AM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

It is, of course, too late to suggest anything for a project of that scale that is well under way...but, for all it's worth, here are my thoughts on packaging. I am with you on modularity. Everyone talks about SOA, but most people continue to build application-centric architectures. In such architectures, services are not reusable for one obvious reason: people bundle things by their type rather then their relevance to a particular functionality. As the result, the implementation of a single functional piece is often sprinkled through a bunch of modules that have names like "model", "domain", "services", "daos", "configuration", etc. There are even worse examples: "exceptions" and "constants". Needless to say, such packaging makes everything tightly coupled with everything. So, if one developer is working on some kind of "User" functionality, he/she is simultaneously messing with your "model.user", "services.user", etc.  This is a very common approach that many projects follow to one degree or another. Even code examples in books and on-line articles advocate that. No wonder, so many projects become so convoluted and dependent on themselves. Why people continue to do so amazes me! As if no one has ever come across a situation when they needed to re-use the same functionality they had just implemented in a web application - for some end-of-day batch process... Except, they can't take it out of their web application because it is totally dependent on the web app's configuration, domain model, daos, services, constants, and exceptions! D'oh!

 

The simple - and most obvious, I would think - solution is to bundle classes in modules according to their functional/problem area. Each module will provide the problem-specific Domain Model and API. It may also provide default implementations of the service and DAOs that applications may re-use if they can. Or, each client application can provide their own implementation of the service that conforms to the API, if necessary. DAOs often will be application-specific if different apps talk to different data sources. For example, you will have modules like this:

 

com.mycompany.core (for all your core/common classes, utilities, and, perhaps some marker interfaces, etc.)

 

com.mycompany.user (User Domain Model, User API, user DAO API+ user svc reference implementation that may be re-used by client apps)

com.mycompany.someservicearea (Domain Model, API, etc.)

 

Then, you will have your applications that will have your re-usable "platform" components as dependencies. You may have web apps, schedulers, batch applications, etc. Each may provide some app-specific domain objects, DAO implementations, presentation-specific packages, etc. But everything that is reusable will live outside - in your "platform".

 

com.mycompany.myapplication.etc.

 

So, your applications should live parallel to your reusable functionality-specific modules.

 

For example, take a look at how the Spring modules are packaged. There is Spring Core, and each individual Spring piece you want to use requires you to include only the minimum dependencies, not the whole Spring stack.

 

 

Agile is good - as long as it is not understood as completely chaotic and messy. In fact, the approach I have just described really helps in agile development because it makes it easier to view modules as complete "black boxes" between the iterations.

 

Cheers,

Constantine

 

P.S. Sorry for the off-topic post!

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Oct 30, 2008 8:54 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

I see the problem, after the 8.0 will be released I'll try to improve the importing logic so that it won't read all project's poms if only one has been changed.

 

Thanks everyone for feedback,

Anton Makeev

Eric Sword Newbie 28 posts since
Jun 17, 2009
Currently Being Moderated
Jun 24, 2009 6:05 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

I just moved to Intellij (EAP #9880) and am hitting the same "re-import triggered for all modules" issue. Has there been any progress in this area since this thread was active last October?

 

Thanks,

 

e

Dmitry Jemerov JetBrains 11,356 posts since
Aug 19, 2002
Currently Being Moderated
Jun 24, 2009 6:18 PM in response to: Eric Sword
Re: Maven integration unusable for larger projects

Hello Eric,

 

I just moved to Intellij (EAP #9880) and am hitting the same

"re-import triggered for all modules" issue. Has there been any

progress in this area since this thread was active last October?

 

Sure. You can find greatly improved Maven integration in Maia EAP builds:

http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP

 

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

 

 

 

Eric Sword Newbie 28 posts since
Jun 17, 2009
Currently Being Moderated
Jun 30, 2009 5:59 PM in response to: Dmitry Jemerov
Re: Maven integration unusable for larger projects

Thanks for the tip.  I'm already experiencing a bit of pain using the 8.1.3 EAP (I'm the one who submitted issues IDEA-23359, 23360, and 23361 for example).  I don't think I want to jump into using a full revisions EAP as my primary dev environment just yet.  Have you all put up any blog entries or other docs that talk about the maven enhancements in Maia?

 

Thanks,

 

e

M. J. Milicevic Apprentice 678 posts since
Aug 22, 2002
Currently Being Moderated
Jun 30, 2009 6:50 PM in response to: Eric Sword
Re: Maven integration unusable for larger projects

Hi Eric,

I am using Maia and maven implementation is greatly improved.

However, it is EAP and I have some "keyboard not responding" issues with Maia form time to time (at least on linux)

Clifton Craig Newbie 26 posts since
Aug 2, 2005
Currently Being Moderated
Jul 2, 2009 10:19 PM in response to: M. J. Milicevic
Re: Maven integration unusable for larger projects

Hi MJ,

 

I've experienced the keyboard not responding issues waay too often and I don't believe they are related to Maia or even IntelliJ. I 've heard of a long standing bug in the AWT toolkit that causes this behavior in Swing apps. The problem has gotten worse for me of the years and I sometimes fall back into Windows. A potential (but not absolute) band-aid would be to put something like this:

AWT_TOOLKIT=XToolkit
#AWT_TOOLKIT=MToolkit

at the top of idea.sh and toggle between the toolkits to see which one locks up the least. Beware as one (and I can't remember which one) works better with Beryl/Compiz-Fusion special effects but may cause the keyboard issue to recurr.

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Jul 1, 2009 5:27 PM in response to: Eric Sword
Re: Maven integration unusable for larger projects

Hi, Eric,

 

You can try Maia 9.0 M1 and next 9.0 eaps and give some feedback so that I could improve the Maven Integration before 9.0 release.

I would appreciate it very much )

 

Thanks,

Anton Makeev

Clifton Craig Newbie 26 posts since
Aug 2, 2005
Currently Being Moderated
Jul 2, 2009 10:30 PM in response to: Anton Makeev
Re: Maven integration unusable for larger projects

Hi Anton,

 

Long time Idea and Maven fan... I'm thinking of upgrading to 9.0M1 as well. I have one other suggestion. Could you change the "Before Launch" in Run/Debug configurations to use sensable defaults in the case of a Maven project? I'd like it to automatically know to use Maven and run test-compile for the module I'm working in rather than defaulting to Idea's "Make" command. the problem I keep stubbing my toe on is certain unit test resources never get pushed out to the test output folder prior to running the tests with Idea's "Make". Maybe adding a custom command line with some sort of macro language like in Eclipse (I shudder to mention or suggest Eclipse features) would help here. Consider this. Projects A, B, and C. I'm working in A and set the default in the run config to Run Maven goal 'test-compile' from A. I then pop over to B and create some unit tests there. If I click the class nameand Ctrl+Shift+F10 to run all tests it picks up the defaults and runs goal 'test-compile' from A leaving my new test un-built and resulting in an error class not found. I have to now either set the run config for B or change my default as I work in B. Then we wash, rinse, repeat when we move on to C.

 

-Cliff

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Jul 10, 2009 6:17 PM in response to: Clifton Craig
Re: Maven integration unusable for larger projects

Hi, Clifton,

 

I see your problem. I believe there is a problem with eigher configuration of test resources or Maven integration: IDEA should automatically pick up test resources and configure project's source folders accordingly.

Could you please attach a sample project so I could fix the problem?

 

Thanks,

Anton Makeev

Frederick N. Brier Newbie 24 posts since
Jun 25, 2003
Currently Being Moderated
Jul 22, 2009 12:55 AM in response to: Anton Makeev
Re: Maven integration unusable for larger projects

I am a long time IDEA user.  The slowness of the Maven integration is killing me too.  Perhaps there are some tricks that could be applied beyond more efficient parsing.

 

  • cache in the workspace file, or somewhere, the dependency relationships (parent/child & import) and modification dates of the poms.
  • if a pom changes, only review poms that depend on that pom or are children.  Do not rescan them all unless explicitly told to do so.
  • Do not rescan all modules at start up if the poms have not changed.
  • When scanning all the modules scan them in the order of the module that has focus and work through its dependencies before modules that are unrelated.  Again, do all the parsing in the background.
  • populate data structures that reflect the maven import and parent child relationships and put a facade around them.  That way if a set of dependencies (.jars) are updated, a modules library list is retrieved by traversing the structure.
  • try to multithread the parsing.  We are all using multi-core systems.  If the datastructures containing the dependencies are separate and linked, then there will be low contention as they are being parsed.

 

Our team is trying to figure out how to break our multi-pom project apart because it is taking so long.  It is killing our productivity.  We are also doing SOA, OSGi, git, and GWT, so IDEA is a great fit, it is just getting too slow.

 

I did try 9.0M1, but could not get it to load the Maven project, so I had to give up and go back to 8.1.

 

A nice feature would be to be able to "New" a new child pom off of a parent module and have it automatically added to the parent and show up as a module.  Trying to get IDEA to recognize the new module is painful doing a rescan, and sometimes does not work.

 

Fred

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Jul 29, 2009 12:03 PM in response to: Frederick N. Brier
Re: Maven integration unusable for larger projects

Hi, Frederick,

 

All that you mentioned has already been implemented in 9.0 branch.

Please tell why couldn't you open your project in 9.0M1, or provide a sample project and I'll try to fix this problem.

 

Thanks,

Anton Makeev

Anton Makeev JetBrains 622 posts since
Dec 19, 2006
Currently Being Moderated
Aug 13, 2009 1:29 PM in response to: Peter Niederwieser
Re: Maven integration unusable for larger projects

Hi, Peter,

 

The problem is that IDEA doesn't current support plain resources folders and in order code-insight features to work Maven have to set such folders as sourse folders.

To temporarily workaround the problem you can exclude such folders from compilation (Settings->Compiler).

 

Thanks,

Anton Makeev

johanlindquist Newbie 6 posts since
Jul 7, 2004
Currently Being Moderated
Sep 16, 2009 11:58 AM in response to: Anton Makeev
Re: Maven integration unusable for larger projects

Hi Anton,

 

I am trying out Maia just now and found that overall the Maven integration is much better - one small (or big depending on the size of your project) issue is happening for me though.

 

If I edit a pom file, IntelliJ will try to 're-import' the module even before I have finished editing (can be halfway into changing a version number for example.

 

Now, this could be a user error, but I fail to find a way to turn this behaviour off.  It seems the 'This file has changed, do you want to re-import' button no longer exists.

 

Cheers,

 

Johan

Thibaut  Apprentice 998 posts since
Jan 27, 2003
Currently Being Moderated
Sep 16, 2009 12:42 PM in response to: johanlindquist
Re: Maven integration unusable for larger projects

I need to say I've encountered this a lot too myself, I've actually come to a point where I edit pom files in another text editor rather than Intellij to avoid this ....

johanlindquist Newbie 6 posts since
Jul 7, 2004
Currently Being Moderated
Sep 16, 2009 4:12 PM in response to: Thibaut
Re: Maven integration unusable for larger projects

I am leaning in that direction, but you loose all the (really nice) auto-complete features ...

Thibaut  Apprentice 998 posts since
Jan 27, 2003
Currently Being Moderated
Sep 16, 2009 5:28 PM in response to: johanlindquist
Re: Maven integration unusable for larger projects

there's a jira for it, which I'll vote for as soon as I manage to log in youtrack (there seem to be issues, the server is not returning the login form), feel free to do so too

 

 

edit : forgot to include the issue id : http://jetbrains.net/tracker/issue/IDEA-23127

johanlindquist Newbie 6 posts since
Jul 7, 2004
Currently Being Moderated
Sep 16, 2009 5:11 PM in response to: Thibaut
Re: Maven integration unusable for larger projects

Will do - if you know the ticket number that would save me some time

Mark Vedder Apprentice 556 posts since
Dec 10, 2003
Currently Being Moderated
Sep 16, 2009 5:25 PM in response to: johanlindquist
Re: Maven integration unusable for larger projects

IDEADEV-39286 "Maven synchronization cuases keyboard and mouse lock ups"  (http://jetbrains.net/tracker/issue/IDEADEV-39286 in the new YouTrack, which is not 100% up and ready yet i believe).

Thibaut  Apprentice 998 posts since
Jan 27, 2003
Currently Being Moderated
Sep 16, 2009 5:34 PM in response to: Mark Vedder
Re: Maven integration unusable for larger projects

http://jetbrains.net/tracker/issue/IDEA-23127 is actually different and is really what I'm suffering : I didn't notice any keyboard /mouse  issues

Mark Vedder Apprentice 556 posts since
Dec 10, 2003
Currently Being Moderated
Sep 16, 2009 6:16 PM in response to: Thibaut
Re: Maven integration unusable for larger projects

Hi Thibaut,

 

39286 may just not have the best name. It's about the issue you described above, where Maven imports too quickly and/or constantly. As a result you cannot type in the POM, or interact with the GUI, while it is importing/synchronizing. For example, sometimes you start typing "org.ap" for a dependency group ID, and IDEA starts to import before you can finish typing the actual group ID ("org.apache,commons"). Like you, I have taken to editing my POMs in an external editor. In 39286, some of the proposed solutions mirror what 23127 suggests: either waiting until the user saves the file before importing, adding a button to manually do the import (as was present in previous IDEA versions), and add a setting to determine if IDEA auto imports or if it is only done manually. So I think these two reports are about the same underlying issue, but focus on different manifestations of the problem.

 

Regards,

Mark

Thibaut  Apprentice 998 posts since
Jan 27, 2003
Currently Being Moderated
Sep 16, 2009 7:43 PM in response to: Mark Vedder
Re: Maven integration unusable for larger projects

makes sense, looks like they're duplicates then

More Like This

  • Retrieving data ...