mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
* [CycloneDX] Add artifactID and groupID to the cycloneDX properties Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> * update comment Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> * additional checks for value Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> * fill group filed with groupID in the case of Java Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> * fix linter warning Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
13 lines
276 B
Go
13 lines
276 B
Go
package cyclonedxhelpers
|
|
|
|
import "github.com/anchore/syft/syft/pkg"
|
|
|
|
func Group(p pkg.Package) string {
|
|
if hasMetadata(p) {
|
|
if metadata, ok := p.Metadata.(pkg.JavaMetadata); ok && metadata.PomProperties != nil {
|
|
return metadata.PomProperties.GroupID
|
|
}
|
|
}
|
|
return ""
|
|
}
|