void () { File targetDir = new File(myMavenProject.getBuildDirectory()); String generatedDir = myMavenProject.getGeneratedSourcesDirectory(false); String generatedDirTest = myMavenProject.getGeneratedSourcesDirectory(true); File[] targetChildren = targetDir.listFiles(); if (targetChildren != null) { for (File f : targetChildren) { if (!f.isDirectory()) continue; if (!FileUtil.pathsEqual(generatedDir, f.getPath()) && !FileUtil.pathsEqual(generatedDirTest, f.getPath())) { if (myImportingSettings.isExcludeTargetFolder()) { if (myModel.hasRegisteredSourceSubfolder(f)) continue; if (myModel.isAlreadyExcluded(f)) continue; myModel.addExcludedFolder(f.getPath()); // is supported in workspace import? } } } } List<String> facetExcludes = new NotNullList<>(); for (MavenImporter each : MavenImporter.getSuitableImporters(myMavenProject)) { each.collectExcludedFolders(myMavenProject, facetExcludes); } for (String eachFolder : facetExcludes) { myModel.unregisterAll(eachFolder, true, true); myModel.addExcludedFolder(eachFolder); } if (myImportingSettings.isExcludeTargetFolder()) { myModel.addExcludedFolder(targetDir.getPath()); } }