mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
Catalog java bundle-version if nothing else found (#677)
This commit is contained in:
parent
f98868b55e
commit
3a10ca7e6a
@ -127,6 +127,7 @@ func selectVersion(manifest *pkg.JavaManifest, filenameObj archiveFilename) stri
|
||||
"Implementation-Version",
|
||||
"Specification-Version",
|
||||
"Plugin-Version",
|
||||
"Bundle-Version",
|
||||
}
|
||||
|
||||
for _, fieldName := range fieldNames {
|
||||
|
||||
@ -212,6 +212,22 @@ func TestSelectVersion(t *testing.T) {
|
||||
},
|
||||
expected: "1.8.2",
|
||||
},
|
||||
{
|
||||
name: "Implementation-Version takes precedence over Specification-Version in subsequent section",
|
||||
manifest: pkg.JavaManifest{
|
||||
Main: map[string]string{
|
||||
"Manifest-Version": "1.0",
|
||||
"Ant-Version": "Apache Ant 1.8.2",
|
||||
"Created-By": "1.5.0_22-b03 (Sun Microsystems Inc.)",
|
||||
},
|
||||
NamedSections: map[string]map[string]string{
|
||||
"some-other-section": {
|
||||
"Bundle-Version": "1.11.28",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: "1.11.28",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user