mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
fix: pom properties not setting artifact id (#1870)
Signed-off-by: James Neate <jamesmneate@gmail.com>
This commit is contained in:
parent
2c5d64ac9e
commit
098c255a2d
@ -69,6 +69,7 @@ func newPackageFromPom(pom gopom.Project, dep gopom.Dependency, locations ...fil
|
||||
m := pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: resolveProperty(pom, dep.GroupID),
|
||||
ArtifactID: resolveProperty(pom, dep.ArtifactID),
|
||||
Scope: resolveProperty(pom, dep.Scope),
|
||||
},
|
||||
}
|
||||
|
||||
@ -28,7 +28,10 @@ func Test_parserPomXML(t *testing.T) {
|
||||
Type: pkg.JavaPkg,
|
||||
MetadataType: pkg.JavaMetadataType,
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{GroupID: "com.joda"},
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "com.joda",
|
||||
ArtifactID: "joda-time",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -41,6 +44,7 @@ func Test_parserPomXML(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "junit",
|
||||
ArtifactID: "junit",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -75,7 +79,10 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Type: pkg.JavaPkg,
|
||||
MetadataType: pkg.JavaMetadataType,
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{GroupID: "org.apache.commons"},
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.apache.commons",
|
||||
ArtifactID: "commons-lang3",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -88,6 +95,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.junit.jupiter",
|
||||
ArtifactID: "junit-jupiter",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -102,6 +110,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.assertj",
|
||||
ArtifactID: "assertj-core",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -116,6 +125,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "commons-io",
|
||||
ArtifactID: "commons-io",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -130,6 +140,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.mockito",
|
||||
ArtifactID: "mockito-inline",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -144,6 +155,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.graalvm.js",
|
||||
ArtifactID: "js",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -158,6 +170,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.graalvm.js",
|
||||
ArtifactID: "js-scriptengine",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -172,6 +185,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.apache.commons",
|
||||
ArtifactID: "commons-rng-simple",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -186,6 +200,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.openjdk.jmh",
|
||||
ArtifactID: "jmh-core",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
@ -200,6 +215,7 @@ func Test_parseCommonsTextPomXMLProject(t *testing.T) {
|
||||
Metadata: pkg.JavaMetadata{
|
||||
PomProperties: &pkg.PomProperties{
|
||||
GroupID: "org.openjdk.jmh",
|
||||
ArtifactID: "jmh-generator-annprocess",
|
||||
Scope: "test",
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user