Skip to content

Commit 0677b0d

Browse files
🐛 Fix file uri path for deps on windows (#772) (#773)
Resolves https://issues.redhat.com/browse/MTA-4636 Signed-off-by: Emily McMullan <[email protected]> Signed-off-by: Cherry Picker <[email protected]> Signed-off-by: Emily McMullan <[email protected]> Signed-off-by: Cherry Picker <[email protected]> Co-authored-by: Emily McMullan <[email protected]>
1 parent 25be1ca commit 0677b0d

File tree

1 file changed

+9
-0
lines changed
  • external-providers/java-external-provider/pkg/java_external_provider

1 file changed

+9
-0
lines changed

external-providers/java-external-provider/pkg/java_external_provider/dependency.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"path/filepath"
1515
"reflect"
1616
"regexp"
17+
"runtime"
1718
"strings"
1819

1920
"github.com/konveyor/analyzer-lsp/engine/labels"
@@ -721,9 +722,17 @@ func (p *javaServiceClient) parseDepString(dep, localRepoPath, pomPath string) (
721722

722723
fp := resolveDepFilepath(&d, p, group, artifact, localRepoPath)
723724

725+
// if windows home path begins with C:
726+
if !strings.HasPrefix(fp, "/") {
727+
fp = "/" + fp
728+
}
724729
d.Labels = addDepLabels(p.depToLabels, d.Name)
725730
d.FileURIPrefix = fmt.Sprintf("file://%v", filepath.Dir(fp))
726731

732+
if runtime.GOOS == "windows" {
733+
d.FileURIPrefix = strings.ReplaceAll(d.FileURIPrefix, "\\", "/")
734+
}
735+
727736
d.Extras = map[string]interface{}{
728737
groupIdKey: group,
729738
artifactIdKey: artifact,

0 commit comments

Comments
 (0)