enable more flexible java manifest structure (closer to the spec)

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2020-10-29 16:26:04 -04:00
parent a4f22e65fc
commit a5cba13ddf
7 changed files with 110 additions and 94 deletions
+2 -10
View File
@@ -22,16 +22,8 @@ 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,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"`
Main map[string]string `json:"main,omitempty"`
Sections map[string]map[string]string `json:"sections,omitempty"`
}
func (m JavaMetadata) PackageURL() string {