Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,14 @@ private Content generateSbomFromEffectivePom() throws IOException {
.filter(d -> d.ignored)
.map(DependencyAggregator::toPurl)
.collect(Collectors.toSet());
var testsDeps =
dependencies.stream()
.filter(DependencyAggregator::isTestDependency)
.collect(Collectors.toSet());
var deps = getDependencies(tmpEffPom);
deps = resolveVersionRanges(deps);
var sbom = SbomFactory.newInstance().addRoot(getRoot(tmpEffPom), readLicenseFromManifest());
deps.stream()
.filter(dep -> !testsDeps.contains(dep))
// exclude test-scoped deps by their own effective-pom scope (version-independent),
// mirroring the JS client. Parent/BOM-managed test deps have no version in the source
// pom, so the version-sensitive equals() match against the original pom would miss them.
.filter(dep -> !dep.isTestDependency())
.map(DependencyAggregator::toPurl)
.filter(dep -> ignored.stream().noneMatch(artifact -> artifact.isCoordinatesEquals(dep)))
.forEach(d -> sbom.addDependency(sbom.getRoot(), d, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
"version" : "2.3.5.RELEASE",
"purl" : "pkg:maven/org.springframework.boot/spring-boot-starter@2.3.5.RELEASE"
},
{
"type" : "library",
"bom-ref" : "pkg:maven/org.springframework.boot/spring-boot-starter-test@2.3.5.RELEASE",
"group" : "org.springframework.boot",
"name" : "spring-boot-starter-test",
"version" : "2.3.5.RELEASE",
"purl" : "pkg:maven/org.springframework.boot/spring-boot-starter-test@2.3.5.RELEASE"
},
{
"type" : "library",
"bom-ref" : "pkg:maven/org.springframework.boot/spring-boot-starter-web@2.3.5.RELEASE",
Expand Down Expand Up @@ -76,7 +68,6 @@
"ref" : "pkg:maven/org.springframework.boot/spring-boot-starter-parent@2.3.5.RELEASE",
"dependsOn" : [
"pkg:maven/org.springframework.boot/spring-boot-starter@2.3.5.RELEASE",
"pkg:maven/org.springframework.boot/spring-boot-starter-test@2.3.5.RELEASE",
"pkg:maven/org.springframework.boot/spring-boot-starter-web@2.3.5.RELEASE",
"pkg:maven/io.quarkus/quarkus-resteasy@2.7.7.Final",
"pkg:maven/org.keycloak/keycloak-saml-core@1.8.1.Final",
Expand All @@ -88,10 +79,6 @@
"ref" : "pkg:maven/org.springframework.boot/spring-boot-starter@2.3.5.RELEASE",
"dependsOn" : [ ]
},
{
"ref" : "pkg:maven/org.springframework.boot/spring-boot-starter-test@2.3.5.RELEASE",
"dependsOn" : [ ]
},
{
"ref" : "pkg:maven/org.springframework.boot/spring-boot-starter-web@2.3.5.RELEASE",
"dependsOn" : [ ]
Expand Down
Loading