As I know for now there is no any feature to do that in intellij idea. I dont know why but they dont support to do that, at least this is the result which I found with all my re
The Offline Module plugin let you disable or enable modules in project without deleting.
Click Disable Module in context menu in Project View, it disables the selected modules. Disabled Modules are shown in a group and can be add back by Load Module.