Managing intelliJ configurations

We are trying to figure out the best way to manage IntelliJ configurations. We have around 300 modules in our repo, so dependencies change and new modules are added frequently.

Some developers also have custom local InteillJ changes which are not required by all. When we regenerate the IJ configurations, they loose their custom configurations.

I have 2 questions:

  • How can we detect and warn users to re-generate their IJ configurations?
  • How can I preserve local custom IJ configurations without overwriting them?

I’d go for the follow workflow:

  1. Generate the project files with the Idea plugin as you do have a lot of customizations.
  2. Import the project into IntelliJ and enable Gradle support in the IDE.
  3. Click the update dependencies option whenever you know something changes. If something doesn’t work anymore, initiate the dependencies option.

How can we detect and warn users to re-generate their IJ configurations?

If you’d want to detect that, then you’d need to write some custom code e.g. iterate over all dependencies, create a hash for each of them and store them on disk. Write some task that checks the hashes whenever you update from VCS. Feels a bit clunky. Ultimately, the IDE should make sure that dependencies are updated automatically after an update from VCS. This would probably be a good additional to the IntelliJ Gradle plugin. You might want to open an issue on their end and see what they think.

How can I preserve local custom IJ configurations without overwriting them?

You could potentially enhance the logic you have in place that generates the project files by additional logic. For example check a directory that contains additional customizations that are applies if found. Then developers could simply put these things into a pre-defined location and they are picked up automatically.

Thanks Ben! I will try that and report back if I have more questions.