NbJavaModule mainModule = currentModel.getMainModule();
classpaths.removeAll(mainModule.getAllBuildOutputs());
for (String inheritedName: sourceSetDependencies) {
JavaSourceSet inherited = mainModule.tryGetSourceSetByName(inheritedName);
if (inherited != null) {
classpaths.removeAll(inherited.getClasspaths().getCompileClasspaths());
classpaths.removeAll(inherited.getClasspaths().getRuntimeClasspaths());
classpaths.remove(inherited.getOutputDirs().getClassesDir());
classpaths.remove(inherited.getOutputDirs().getResourcesDir());
classpaths.removeAll(inherited.getOutputDirs().getOtherDirs());
}
}
List<SingleNodeFactory> dependencyNodes = filesToNodes(currentModel, classpaths);
dependencyNodes = sortDependencyNodes(dependencyNodes);