boolean (MavenProject project) { Module existingModule = myMavenProjectToModule.get(project); if (existingModule != null && existingModule != myPreviewModule) { myCreatedModules.add(existingModule); // compatibility with workspace importer return false; } final String path = myMavenProjectToModulePath.get(project); String moduleName = ModulePath.Companion.getModuleNameByFilePath(path); // for some reason newModule opens the existing iml file, so we // have to remove it beforehand. deleteExistingImlFile(path); deleteExistingModuleByName(moduleName); final Module module = myModuleModel.newModule(path, project.getModuleType().getId()); myMavenProjectToModule.put(project, module); myCreatedModules.add(module); return true; }