Skip to content

Commit

Permalink
Merge pull request #179 from siemens/defect/maven_fileparse
Browse files Browse the repository at this point in the history
Error to be displayed when Components are not present in the BOM for MAVEN package type
  • Loading branch information
karthika-g authored Jul 4, 2024
2 parents 1b4cf77 + 696ffd1 commit 49a215b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CA.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package >
<metadata>
<id>continuous-clearing</id>
<version>6.2.1</version>
<version>6.2.2</version>
<authors>Siemens AG</authors>
<owners>continuous-clearing contributors</owners>
<projectUrl>https://github.com/siemens/continuous-clearing</projectUrl>
Expand Down
13 changes: 11 additions & 2 deletions src/LCT.PackageIdentifier/MavenProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ public Bom ParsePackageFile(CommonAppSettings appSettings)
if (!filepath.EndsWith(FileConstant.SBOMTemplateFileExtension))
{
Bom bomList = ParseCycloneDXBom(filepath);
CheckValidComponentsForProjectType(bomList.Components, appSettings.ProjectType);

if (bomList?.Components != null)
{
CheckValidComponentsForProjectType(bomList.Components, appSettings.ProjectType);
}
else
{
Logger.Warn("No components found in the BOM file : " + filepath);
continue;
}

if (componentsForBOM.Count == 0)
{
Expand Down Expand Up @@ -86,7 +95,7 @@ public Bom ParsePackageFile(CommonAppSettings appSettings)
componentsForBOM = ListOfComponents.Distinct(new ComponentEqualityComparer()).ToList();

BomCreator.bomKpiData.DuplicateComponents = totalComponentsIdentified - componentsForBOM.Count;


if (appSettings.Maven.ExcludedComponents != null)
{
Expand Down

0 comments on commit 49a215b

Please sign in to comment.