List<Module> () { ModuleManager moduleManager = ModuleManager.getInstance(myProject); List<Module> jvmModules = new ArrayList<>(); for (Module module : moduleManager.getModules()) { ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); if (!moduleRootManager.getSourceRoots(JavaModuleSourceRootTypes.SOURCES).isEmpty() || !moduleRootManager.getSourceRoots(JavaModuleSourceRootTypes.RESOURCES).isEmpty()) { jvmModules.add(module); } } return jvmModules; }