Updating the code location handling
@@ -166,13 +166,16 @@ public class DetectProjectManager implements SummaryResultReporter, ExitCodeRepo
final Set<String> bdioFileNames = new HashSet<>();
for (final DetectCodeLocation detectCodeLocation : detectProject.getDetectCodeLocations()) {
+ if (detectCodeLocation.getDependencyGraph() == null) {
+ logger.warn(String.format("Dependency graph is null for code location %s", detectCodeLocation.getSourcePath()));
+ continue;
+ }
+ if (detectCodeLocation.getDependencyGraph().getRootDependencies().size() <= 0) {
+ logger.warn(String.format("Could not find any dependencies for code location %s", detectCodeLocation.getSourcePath()));
+ }
if (StringUtils.isNotBlank(detectConfiguration.getAggregateBomName())) {
aggregateDependencyGraph.addGraphAsChildrenToRoot(detectCodeLocation.getDependencyGraph());
} else {
- if (detectCodeLocation.getDependencyGraph() == null || detectCodeLocation.getDependencyGraph().getRootDependencies().size() <= 0) {
- logger.warn(String.format("Could not find any dependencies for code location %s", detectCodeLocation.getSourcePath()));
- }
-
final String projectName = detectProject.getProjectName();
final String projectVersionName = detectProject.getProjectVersionName();
@@ -185,6 +188,7 @@ public class DetectProjectManager implements SummaryResultReporter, ExitCodeRepo
throw new DetectUserFriendlyException(String.format("Found duplicate Code Locations with the name: %s", codeLocationNameString), ExitCodeType.FAILURE_GENERAL_ERROR);
}
final SimpleBdioDocument simpleBdioDocument = createSimpleBdioDocument(codeLocationNameString, detectProject, detectCodeLocation);
+
final String finalSourcePathPiece = detectFileManager.extractFinalPieceFromPath(detectCodeLocation.getSourcePath());
final String filename = generateShortenedFilename(detectCodeLocation.getBomToolType(), finalSourcePathPiece, detectCodeLocation.getBomToolProjectExternalId());
if (!bdioFileNames.add(filename)) {
