void () { // do not add resource roots for 'pom' packaging projects if ("pom".equals(mavenProject.getPackaging())) return; VirtualFile pomXml = mavenProject.getFile(); Module module = fileIndex.getModuleForFile(pomXml); if (module == null) return; if (!Comparing.equal(mavenProject.getDirectoryFile(), fileIndex.getContentRootForFile(pomXml))) return; var javaVersions = MavenImportUtil.getMavenJavaVersions(mavenProject); var moduleType = MavenImportUtil.getModuleType(mavenProject, javaVersions); generate(module, moduleType); if (moduleType == StandardMavenModuleType.COMPOUND_MODULE) { var moduleManager = ModuleManager.getInstance(module.getProject()); var moduleName = module.getName(); generate(moduleManager.findModuleByName(moduleName + MAIN_SUFFIX), StandardMavenModuleType.MAIN_ONLY); generate(moduleManager.findModuleByName(moduleName + TEST_SUFFIX), StandardMavenModuleType.TEST_ONLY); } }