18

If I import a Maven project (Import Project > choose the main pom.xml file > check Import Maven projects automatically > Next ...):

  • in IntelliJ IDEA 14.1 Ultimate Edition it takes about 5 hours until is ready.
  • in IntelliJ IDEA 14.0.3 Ultimate Edition it was about 20 times faster.

During the processing, if I maximize a popup it looks like: enter image description here

The modules (folders) in the Project area are shown only at the end (only the files from the main directory are shown during the "resolving" - in this case immediately).

The jar files are already in the .m2 folder, so the problem is not related to the time for downloading those jars.

Is there a "hidden" setting needed to improve the performance? (a check box, a command, etc.)

Details:

  • Windows 7
  • Java 7
  • Apache Maven 3.2.1

Edit:

  • JDK, Maven, .m2, IntelliJ IDEA and the project sources are on the same drive
  • JetBrains wrote:

    Your projects open faster and the IDE is more responsive as some processes now run in the background.

    regarding IntelliJ IDEA 14.1 and probably it is faster but (at least for me) not using the default settings.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
  • 1
    I had my maven home in on a different drive, and it reset itself sometimes after a IJ re-install / upgrade. Check the settings for the maven home in IJ – mish Mar 26 '15 at 13:37
  • 4
    This should like an issue with 14.1. I think you should report it as a n IntelliJ bug. – uwolfer Mar 26 '15 at 14:38

2 Answers2

41

If you use the bundled Maven that comes with Idea 14.1, have a look here: Slow Intellij IDEA deployment . Using an installed Maven seems to be much faster.

enter image description here

Another improvement could be to change the JDK for importer (and probably the VM options for importer) from Use internal JRE to your own JDK: enter image description here

Community
  • 1
  • 1
Alexander
  • 2,925
  • 3
  • 33
  • 36
  • 3
    Thank you. This solved almost the whole problem. In background it is still resolving some dependencies and some classes are still not recognized, but I can perform a lot of actions during the background processing (browsing through files, editing some code, etc.). – ROMANIA_engineer Mar 26 '15 at 23:16
  • 3
    After I changed both Maven & Java to my own versions the total time was reduced considerably from 5 hours to 5 minutes. – ROMANIA_engineer Mar 26 '15 at 23:39
  • This solved many problems with Intellij and Maven been slow in general for me. One of the worst of these occurred when having a big external library dependency with runtime scope to do some tests etc (e.g. Spark) and each time i made a small change to pom or changed branch in git that would trigger a pom parsing, intellij was unresponsive for 15 - 20 secs on an I7 3.5 ghz – nvrs Aug 28 '15 at 10:29
  • Import speed depends mostly on Maven version used. Doesn't matter IDEA internal or you own. – Denis Rozhnev Apr 10 '19 at 11:41
  • @nvrs, you can switch off auto import. – Denis Rozhnev Apr 10 '19 at 11:43
  • @Alexander which VM options to use for improving the maven imports? – Gaurav May 03 '19 at 10:51
3
  1. It's all because Maven version. Maven 3.0.5 or Maven 2.x use simplified dependency resolution so often it can be used during import for big projects. Thought it can work incorrect for some projects which uses 3.1+ Maven.
  2. Switching off auto-importing is another solution.
Denis Rozhnev
  • 2,547
  • 1
  • 14
  • 15