IntelliJ IDEA 2017.2 Help

Temporarily ignoring unused modules

Why would I want to unload modules?

To make the IDE work faster, you can unload the modules that you are not working on at the moment. IntelliJ IDEA ignores the unloaded modules when you search or refactor your code, or compile your project.

The info about the unloaded modules is not shared through version control. So you can temporarily unload unnecessary modules without affecting your teammates' project configurations.

How do I unload or load modules?

  1. In the Project tool window, right-click any element and select Load/Unload Modules.
    /help/img/idea/2017.2/Unload_modules_1.png
  2. Load or unload the modules in the dialog that opens.
    /help/img/idea/2017.2/Unload_modules_2.png

Are there any potential problems?

Problems may arise when there are dependencies between loaded and unloaded modules.

To illustrate, let's assume that a module A depends on a module B, and you:

  • unload B while A stays loaded:
    • References to classed contained in B will be shown as unresolved (red).
    • Compilation of A, most likely, will fail.
  • unload A while B stays loaded:
    • There will be no associated errors in your code.
    • The compilation of B will be a success.
    • When you invoke Find Usages or refactoring on a class, field, method, etc. contained in B, the result may be incomplete (because the contents of A are not taken into account), and IntelliJ IDEA will inform you of that.
    • You may accidentally break the compilation of dependent code in A by making changes to your code in B. Because A isn't compiled when you compile your project, there will be no indication of potential compilation failure.
Last modified: 11 October 2017