File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,14 @@ func (m *Decoder) pkgName(pkg *ftypes.Package, c *core.Component) string {
256
256
return pkg .Name
257
257
}
258
258
259
+ // `maven purl type` has no restrictions on using lowercase letters.
260
+ // Also, `spdx-maven-plugin` uses `name` instead of `artifactId` for the `package name` field.
261
+ // So we need to use `purl` for maven/gradle packages
262
+ // See https://github.com/aquasecurity/trivy/issues/7007 for more information.
263
+ if p .Type == packageurl .TypeMaven || p .Type == packageurl .TypeGradle {
264
+ return pkg .Name
265
+ }
266
+
259
267
// TODO(backward compatibility): Remove after 03/2025
260
268
// Bitnami used different pkg.Name and the name from PURL.
261
269
// For backwards compatibility - we need to use PURL.
@@ -265,9 +273,6 @@ func (m *Decoder) pkgName(pkg *ftypes.Package, c *core.Component) string {
265
273
}
266
274
267
275
if c .Group != "" {
268
- if p .Type == packageurl .TypeMaven || p .Type == packageurl .TypeGradle {
269
- return c .Group + ":" + c .Name
270
- }
271
276
return c .Group + "/" + c .Name
272
277
}
273
278
return c .Name
You can’t perform that action at this time.
0 commit comments