From 5e06bde89851a54deb1a20fce5ddb9719276e1f1 Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Wed, 11 Dec 2024 17:23:33 -0500 Subject: [PATCH] :bug: Remove slash from java bundle for windows (#745) relies on https://github.com/konveyor/java-analyzer-bundle/pull/115 Signed-off-by: Emily McMullan Signed-off-by: Cherry Picker --- .../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))