Migrating IntelliJ’s build to use Maven project libraries

Historically, all libraries used for building IntelliJ have been stored, as JAR files, directly in the IntelliJ git repositories. This approach has several downsides, such as increasing the size of the git repo whenever we need to update to a new version. Also, who wants to manually manage dependencies and versions these days? We’ve recently made some changes to try and improve this situation.

Ideally, moving the IntellIJ IDEA project to a modern dependency management system such as Gradle would allow us to solve these problems. Unfortunately, the IntelliJ project is very large, and right now, there are performance issues when synchronising a Gradle project of that size with IntelliJ’s project model. This is something we’re working on with the folks from Gradle, and hope to make this happen at some point in the future.

In the meantime, we’re taking small steps, and have started migrating our libraries to be Maven project libraries. This is a feature that IntelliJ has had for a while, and we improved it in IntelliJ 2017.2.

Project libraries dialog

Instead of storing the JAR files as part of the source tree, we can now simply store the Maven coordinates of the dependency, and IntelliJ will automatically download any JARs and source zips when you open or build the project. As part of the updates for IntelliJ 2017.2, the build scripts for IntelliJ-based products are also aware of repository libraries and will also download the JAR files if necessary.

The master branch of the IntelliJ IDEA Community Edition sources already has some repository libraries. We’re going to use this approach for any new libraries we add, and we’ll be gradually migrating existing libraries over time. Please make sure you’re using IntelliJ 2017.2.1 or newer to work with the IntelliJ sources, as stated in the README.

Comments below can no longer be edited.

3 Responses to Migrating IntelliJ’s build to use Maven project libraries

  1. Avatar

    Eric Wendelin says:

    October 9, 2017

    Hey Matt,

    I lead developer experience at Gradle, and I’m sorry to hear about your troubles converting to Gradle. Lots of folks with very large projects are able to achieve a highly-performant build with Gradle, but it’s not as easy as we’d like, and that’s why I’m here.

    I would personally love to discuss this in-depth with you and Nikita and see how we can help you out and learn from you how to make scaling Gradle builds easier. Please email me at your earliest convenience.

    • Avatar

      Matt Ellis says:

      October 9, 2017

      Hi Eric. Apologies, I wasn’t clear enough in the post, and I’ve just updated it.

      It’s definitely possible to have very large Gradle projects with good performance. Our problems are due to our requirements as an IDE – we need to use Gradle to load project configuration, and keep this up to date when the build files change. Currently, this is taking too much time for us to be able to successfully convert all of IntelliJ to Gradle – which would be 800+ build.gradle files.

      I’ve not been involved in the discussions myself, but I know we’ve been in contact with (presumably some of your colleagues at) Gradle about this, and hopefully we’ll be able to make some progress on this. Thanks for reaching out – I’ve forwarded this to the team and they should be in touch.

      • Avatar

        Eric Wendelin says:

        October 9, 2017

        Ah, thanks for additional context, Matt. I know Nikita has been discussing with Stefan from our team, and I have recently begun to look at how we can help here.

        We’ll surely be in touch, then. In the meantime, feel free to reach out to me directly if there’s any way we can make your or everyone’s Gradle experience better.

Discover more