diff --git a/src/main/groovy/com/blackducksoftware/integration/hub/detect/bomtool/CranBomTool.groovy b/src/main/groovy/com/blackducksoftware/integration/hub/detect/bomtool/CranBomTool.groovy index 9d0154545..a0e219779 100644 --- a/src/main/groovy/com/blackducksoftware/integration/hub/detect/bomtool/CranBomTool.groovy +++ b/src/main/groovy/com/blackducksoftware/integration/hub/detect/bomtool/CranBomTool.groovy @@ -71,9 +71,14 @@ class CranBomTool extends BomTool { List packratLockText = Files.readAllLines(packratLockFile[0].toPath(), StandardCharsets.UTF_8) DependencyGraph dependencyGraph = packratPackager.extractProjectDependencies(packratLockText) - ExternalId externalId = externalIdFactory.createNameVersionExternalId(Forge.CRAN, projectName, projectVersion) + ExternalId externalId = externalIdFactory.createPathExternalId(Forge.CRAN, sourcePath) - def codeLocation = new DetectCodeLocation.Builder(getBomToolType(), sourcePath, externalId, dependencyGraph).bomToolProjectName(projectName).bomToolProjectVersionName(projectVersion).build() + DetectCodeLocation.Builder builder = + new DetectCodeLocation.Builder(getBomToolType(), sourcePath, externalId, dependencyGraph) + .bomToolProjectName(projectName) + .bomToolProjectVersionName(projectVersion); + + def codeLocation = builder.build() [codeLocation] } }