I have a module that has a module dependency called shared which has the majority of my applications code across all applications. There are classes in shared that reference for example the servlet 3.0 API (jar dependency) that are not used in this module among a bunch of other stuff. Intellij looks like it compiles everything in a module, unlike eclipse, including when compiling with maven. With Eclipse, eclipse only compiles files that are imported into the application. Is there a way to change this?