From 47720795430f3810aae10de3c321bff894028c10 Mon Sep 17 00:00:00 2001 From: "konveyor-ci-bot[bot]" <159171263+konveyor-ci-bot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:40:26 -0500 Subject: [PATCH] :bug: Remove slash from java bundle for windows (#745) (#750) relies on https://github.com/konveyor/java-analyzer-bundle/pull/115 Signed-off-by: Emily McMullan Signed-off-by: Cherry Picker Signed-off-by: Emily McMullan Signed-off-by: Cherry Picker Co-authored-by: Emily McMullan --- .../pkg/java_external_provider/filter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/external-providers/java-external-provider/pkg/java_external_provider/filter.go b/external-providers/java-external-provider/pkg/java_external_provider/filter.go index 2dbd7d73..2ce8d519 100644 --- a/external-providers/java-external-provider/pkg/java_external_provider/filter.go +++ b/external-providers/java-external-provider/pkg/java_external_provider/filter.go @@ -7,6 +7,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strconv" "strings" @@ -198,6 +199,11 @@ func (p *javaServiceClient) getURI(refURI string) (string, uri.URI, error) { jarPath = filepath.Join(filepath.Dir(u.Path), jarName) } + // these are added in bundle + if runtime.GOOS == "windows" { + jarPath = strings.TrimPrefix(jarPath, "\\") + } + path := filepath.Join(strings.Split(strings.TrimSuffix(packageName, ".class"), ".")...) // path: org/apache/logging/log4j/core/appender/FileManager javaFileName := fmt.Sprintf("%s.java", filepath.Base(path))