void (StandardMavenModuleType type) { if (!myImportingSettings.isKeepSourceFolders()) { myModel.clearSourceFolders(); } boolean isTest = type == StandardMavenModuleType.TEST_ONLY; Map<String, JpsModuleSourceRootType<?>> sourceFolders = isTest ? getTestSourceFolders(myMavenProject) : getMainSourceFolders(myMavenProject); java.nio.file.Path contentRootPath = java.nio.file.Path.of(myMavenProject.getDirectory(), "src", isTest ? "test" : "main"); String defaultContentRoot = contentRootPath.toString(); boolean containDefaultContentRoot = false; for (String path : sourceFolders.keySet()) { if (!containDefaultContentRoot) { containDefaultContentRoot = path.contains(defaultContentRoot); } } sourceFolders.forEach((p, t) -> myModel.addSourceFolder(p, t)); configOutputFolders(isTest); configGeneratedFolders(isTest); generateNewContentRoots(containDefaultContentRoot ? contentRootPath : null); }