Skip to content

Commit bfd45aa

Browse files
committed
fix mvn Xray comp id
1 parent 0e16f0c commit bfd45aa

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

tests/testdata/output/audit/audit_simple_json.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"name": "lodash",
1111
"version": "4.17.0",
1212
"location": {
13-
"file": "Users/user/project-with-issues/package.json"
13+
"file": "package.json"
1414
}
1515
}
1616
],
@@ -56,7 +56,7 @@
5656
"name": "jake",
5757
"version": "10.8.7",
5858
"location": {
59-
"file": "Users/user/project-with-issues/package.json"
59+
"file": "package.json"
6060
}
6161
}
6262
],
@@ -183,7 +183,7 @@
183183
"name": "jake",
184184
"version": "10.8.7",
185185
"location": {
186-
"file": "Users/user/project-with-issues/package.json"
186+
"file": "package.json"
187187
}
188188
}
189189
],

tests/utils/test_utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ func PrepareAnalyzerManagerResource() (err error) {
453453
if err := biutils.CopyDir(localPath, amLocalPath, true, []string{}); err != nil {
454454
return fmt.Errorf("failed to copy analyzer manager from %s to %s: %w", localPath, amLocalPath, err)
455455
}
456+
return nil
456457
}
457458
return jas.DownloadAnalyzerManagerIfNeeded(0)
458459
}

utils/techutils/techutils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,9 @@ func ConvertXrayPackageType(xrayPackageType string) string {
830830
}
831831

832832
func ToXrayComponentId(packageType, componentName, componentVersion string) string {
833+
if packageType == "gav" {
834+
componentName = strings.ReplaceAll(componentName, "/", ":")
835+
}
833836
if componentVersion == "" {
834837
// If the component version is empty, we return the component name only
835838
return fmt.Sprintf("%s://%s", packageType, componentName)

0 commit comments

Comments
 (0)