Sbt ignores target directories that are children of already scanned target directories.
@@ -161,10 +161,12 @@ class SbtBomTool extends BomTool {
}
File[] additionalTargets = detectFileManager.findFilesToDepth(sourcePath, 'target', depth)
+ List<File> scanned = new ArrayList<File>();
if (additionalTargets) {
additionalTargets.each {
- if (!isInProject(it, sourcePath)) {
+ if (!isInProject(it, sourcePath) && isNotChildOfScanned(it, scanned)) {
hubSignatureScanner.registerPathToScan(it)
+ scanned.add(it)
}
}
}
@@ -172,6 +174,15 @@ class SbtBomTool extends BomTool {
modules
}
+ Boolean isNotChildOfScanned(File folder, List<File> scanned) {
+ for(def scan : scanned){
+ if (folder.getCanonicalPath().startsWith(scan.getCanonicalPath())) {
+ return false
+ }
+ }
+ return true
+ }
+
Boolean isInProject(File file, String sourcePath){
def projectPath = new File(sourcePath, PROJECT_FOLDER)
return file.getCanonicalPath().startsWith(projectPath.getCanonicalPath())
