[fix]: [AH-1262]: Fix get files api for maven when artifact id contains dot (#3730)

* [fix]: [AH-1262]: Fix get files api when artifact id contains dot
* [fix]: [AH-1262]: Fix get files api when artifact id contains dot
* [fix]: [AH-1262]: Fix get files api when artifact id contains dot
This commit is contained in:
Pragyesh Mishra 2025-04-30 13:53:49 +00:00 committed by Harness
parent 8f7e024c9b
commit c91ba3d8d3

View File

@ -22,9 +22,12 @@ import (
) )
func GetMavenFilePath(imageName string, version string) string { func GetMavenFilePath(imageName string, version string) string {
artifactName := strings.ReplaceAll(imageName, ".", "/") parts := strings.SplitN(imageName, ":", 2)
artifactName = strings.ReplaceAll(artifactName, ":", "/") filePathPrefix := "/"
filePathPrefix := "/" + artifactName if len(parts) == 2 {
groupID := strings.ReplaceAll(parts[0], ".", "/")
filePathPrefix += groupID + "/" + parts[1]
}
if version != "" { if version != "" {
filePathPrefix += "/" + version filePathPrefix += "/" + version
} }