allow for java manifest data to be optional

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2020-10-29 11:28:27 -04:00
parent 452426d1d6
commit 1230650771
6 changed files with 98 additions and 29 deletions
+9 -9
View File
@@ -22,15 +22,15 @@ type PomProperties struct {
// JavaManifest represents the fields of interest extracted from a Java archive's META-INF/MANIFEST.MF file.
type JavaManifest struct {
Name string `mapstructure:"Name" json:"name"`
ManifestVersion string `mapstructure:"Manifest-Version" json:"manifestVersion"`
SpecTitle string `mapstructure:"Specification-Title" json:"specificationTitle"`
SpecVersion string `mapstructure:"Specification-Version" json:"specificationVersion"`
SpecVendor string `mapstructure:"Specification-Vendor" json:"specificationVendor"`
ImplTitle string `mapstructure:"Implementation-Title" json:"implementationTitle"`
ImplVersion string `mapstructure:"Implementation-Version" json:"implementationVersion"`
ImplVendor string `mapstructure:"Implementation-Vendor" json:"implementationVendor"`
Extra map[string]string `mapstructure:",remain" json:"extraFields"`
Name string `mapstructure:"Name" json:"name,omitempty"`
ManifestVersion string `mapstructure:"Manifest-Version" json:"manifestVersion,omitempty"`
SpecTitle string `mapstructure:"Specification-Title" json:"specificationTitle,omitempty"`
SpecVersion string `mapstructure:"Specification-Version" json:"specificationVersion,omitempty"`
SpecVendor string `mapstructure:"Specification-Vendor" json:"specificationVendor,omitempty"`
ImplTitle string `mapstructure:"Implementation-Title" json:"implementationTitle,omitempty"`
ImplVersion string `mapstructure:"Implementation-Version" json:"implementationVersion,omitempty"`
ImplVendor string `mapstructure:"Implementation-Vendor" json:"implementationVendor,omitempty"`
Extra map[string]string `mapstructure:",remain" json:"extraFields,omitempty"`
Sections []map[string]string `json:"sections,omitempty"`
}