IntelliJ IDEA 2017.3 EAP brings improvements for unloaded modules
The latest IntelliJ IDEA 2017.3 EAP build brings lots of new features, and now it’s time to take a look at the improvements for unloaded modules.
In IntelliJ IDEA 2017.2 we announced an experimental feature called Load/Unload Modules. This feature allows you to unload unnecessary temporary modules from your project. The Load/Unload Modules feature is especially useful for managing modules in large projects.
Until now, however, if you updated via a VCS, all newly added modules were marked as loaded by default. This was not very convenient and in some cases could even lead to compilation failures.
Initially, the project only had only three modules: pluginA, pluginB and platform. Let’s assume you’re currently working on pluginA. Because it depends on platform, you marked these two as loaded modules, while pluginB stays unloaded. Then a colleague adds pluginC and util to the project and you get these modules from your VCS. Platform depends on util, and pluginC depends on platform.
Previously, the IDE marked all newly added modules as loaded. But starting with this new EAP, IntelliJ IDEA will analyze all added modules. In the example above, only util will be treated as a loaded module, and pluginC will stay unloaded.
IntelliJ IDEA 2017.3 will alert you to this:
Another new enhancement in this area is a сheck for unloaded modules to compile successfully before a commit.
In most cases, IntelliJ IDEA detects possible problems and alerts you to them. Invoke a refactoring on some element from platform, and the IDE will show a warning if this change affects unloaded modules. Still, there are situations when you can easily break compilation for unloaded modules without even noticing it.
Back to our example, pluginB depends on platform. If you write a new method in an interface in platform and this interface is implemented in pluginB, compilation for unloaded plugin B will fail when you load it back. Previously, the IDE didn’t detect a potential problem, even though committing such changes could break the compilation of the whole project.
In this EAP, we have resolved this issue by adding an option called ‘compile affected unloaded modules’ to the ‘Commit Changes‘ dialog. This option triggers the compilation of unloaded modules if a commit includes changes that affect modules that depend on unloaded ones.
Subscribe to Blog updates
Thanks, we've got you!
IntelliJ IDEA 2023.3 Release Candidate Is Out
IntelliJ IDEA 2023.3 Release Candidate is now available! You can get the latest build from our website, through the free Toolbox App, or via snaps for Ubuntu. To use this build, you need to have an active subscription to IntelliJ IDEA Ultimate. Download IntelliJ IDEA 2023.3 RC As we …
The What, Why, and How of JPA Buddy in IntelliJ IDEA
Master JPA entity management with JPA Buddy in IntelliJ IDEA! Our latest article shows you how to simplify your workflow and reduce boilerplate code.
IntelliJ IDEA 2023.3 Beta 3 Is Out!
IntelliJ IDEA 2023.3 Beta 3 is now available for download! You can get the latest build through our website, the free Toolbox App, from inside the IDE, or by using snaps for Ubuntu. Download IntelliJ IDEA Beta 3 This marks the last week before the release candidate is scheduled for delivery…
IntelliJ IDEA 2023.3 Beta 2 Is Out!
IntelliJ IDEA 2023.3 Beta 2 is out and ready for you to download! You can get the latest build from our website or via the free Toolbox App. You can also upgrade to 2023.3 Beta 2 from inside the IDE, or by using snaps for Ubuntu. Download IntelliJ IDEA Beta 2 While the team puts the finishi…