Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA: how to rebuild groups of modules?

In my IntelliJ IDEA project I've got a couple of modules. Some of the are separate webapps (WARs), some of them are libraries shared by the webapps (JARs).

Imagine for example modules war1 and war2, each dependent on module jar1.

I need to have all these modules in the project because if I break something in jar1 I want to know if war1 AND war2 compile.

Now, if I change something in jar1 (and see that something's not getting updated) I just use 'Rebuild project' - then everything gets rebuilt and this is fine.

But when I change something in war1 I just want to rebuild war1 (or sometimes war1 + jar1). The 'Make module' option does not always work the way I want because it does not seem to clean the output directory.

I put jar1 and war1 into a separate group but I also don't see a 'Rebuild group' feature.

The reason for why 'Rebuild project' is not enough sometimes is that it takes a lot of time to rebuild ALL modules. I also don't see any 'Clean output directory' feature (if I had it I could clean just one module and then make this module).

Thanks in advance for any hints.

like image 484
machinery Avatar asked Oct 24 '25 06:10

machinery


1 Answers

There is an option to Rebuild the selected module (you can't rebuild a group of modules), also note that Make is enough in 99% cases and you don't have to Rebuild, however you may need to rebuild artifacts (Build | Build Artifacts), you can multiple select several artifacts, then rebuild the selected.

like image 184
CrazyCoder Avatar answered Oct 27 '25 00:10

CrazyCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!