remove parent java package from json && add java manifest section parsing

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2020-10-28 17:19:06 -04:00
parent 62f6146c37
commit 2675891110
5 changed files with 126 additions and 305 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ type JavaMetadata struct {
VirtualPath string `json:"virtualPath"`
Manifest *JavaManifest `mapstructure:"Manifest" json:"manifest,omitempty"`
PomProperties *PomProperties `mapstructure:"PomProperties" json:"pomProperties,omitempty"`
Parent *Package `json:"parentPackage,omitempty"` // TODO: should this be included in the json output?
Parent *Package `json:"-"`
}
// PomProperties represents the fields of interest extracted from a Java archive's pom.xml file.
@@ -31,7 +31,7 @@ type JavaManifest struct {
ImplVersion string `mapstructure:"Implementation-Version" json:"implementationVersion"`
ImplVendor string `mapstructure:"Implementation-Vendor" json:"implementationVendor"`
Extra map[string]string `mapstructure:",remain" json:"extraFields"`
Sections []map[string]string `json:"sections"`
Sections []map[string]string `json:"sections,omitempty"`
}
func (m JavaMetadata) PackageURL() string {