Skip to content

Commit

Permalink
🐛 fix maven download of deps when they are downloaded to a different …
Browse files Browse the repository at this point in the history
…location

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
  • Loading branch information
pranavgaikwad committed Aug 1, 2024
1 parent fb8315c commit f3fcedd
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion external-providers/dotnet-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/konveyor/dotnet-external-provider
go 1.20

require (
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd
go.lsp.dev/jsonrpc2 v0.10.0
go.lsp.dev/protocol v0.12.0
go.lsp.dev/uri v0.3.0
Expand Down
2 changes: 2 additions & 0 deletions external-providers/dotnet-external-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd h1:mDu+2r8AIDxoIQ8UrGFT3AYygPBZFfQOVL3YfJIPkMw=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd/go.mod h1:Gqj6MRUA2Jjjw19tUguJB6Bqj4dLwZzb68FmAUok0ac=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down
2 changes: 1 addition & 1 deletion external-providers/generic-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/bombsimon/logrusr/v3 v3.1.0
github.com/go-logr/logr v1.2.4
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd
github.com/sirupsen/logrus v1.9.3
github.com/swaggest/openapi-go v0.2.45
go.lsp.dev/uri v0.3.0
Expand Down
2 changes: 2 additions & 0 deletions external-providers/generic-external-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd h1:mDu+2r8AIDxoIQ8UrGFT3AYygPBZFfQOVL3YfJIPkMw=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd/go.mod h1:Gqj6MRUA2Jjjw19tUguJB6Bqj4dLwZzb68FmAUok0ac=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down
2 changes: 1 addition & 1 deletion external-providers/golang-dependency-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/konveyor/golang-dependency-provider
go 1.19

require (
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd
go.lsp.dev/uri v0.3.0
google.golang.org/grpc v1.62.1 // indirect
)
Expand Down
2 changes: 2 additions & 0 deletions external-providers/golang-dependency-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd h1:mDu+2r8AIDxoIQ8UrGFT3AYygPBZFfQOVL3YfJIPkMw=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd/go.mod h1:Gqj6MRUA2Jjjw19tUguJB6Bqj4dLwZzb68FmAUok0ac=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down
2 changes: 1 addition & 1 deletion external-providers/java-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/go-logr/logr v1.4.1
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd
github.com/swaggest/openapi-go v0.2.50
go.lsp.dev/uri v0.3.0
go.opentelemetry.io/otel v1.11.2
Expand Down
2 changes: 2 additions & 0 deletions external-providers/java-external-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd h1:mDu+2r8AIDxoIQ8UrGFT3AYygPBZFfQOVL3YfJIPkMw=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd/go.mod h1:Gqj6MRUA2Jjjw19tUguJB6Bqj4dLwZzb68FmAUok0ac=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ func (p *javaProvider) Init(ctx context.Context, log logr.Logger, config provide
log.Info("downloading maven artifact", "artifact", mvnCoordinates, "options", mvnOptions)
cmd := exec.CommandContext(ctx, "mvn", mvnOptions...)
cmd.Dir = outputDir
if err := cmd.Run(); err != nil {
mvnOutput, err := cmd.CombinedOutput()
if err != nil {
cancelFunc()
return nil, additionalBuiltinConfig, fmt.Errorf("error downloading java artifact %s - %w", mvnUri, err)
}
Expand All @@ -282,6 +283,16 @@ func (p *javaProvider) Init(ctx context.Context, log logr.Logger, config provide
downloadedPath = filepath.Join(outputDir,
fmt.Sprintf("%s.%s", strings.Join(mvnCoordinatesParts[1:3], "-"), strings.ToLower(mvnCoordinatesParts[3])))
}
outputLinePattern := regexp.MustCompile(`.*?Copying.*?to (.*)`)
log.Info("got maven output", "output", mvnOutput)
for _, line := range strings.Split(string(mvnOutput), "\n") {
if outputLinePattern.MatchString(line) {
match := outputLinePattern.FindStringSubmatch(line)
if match != nil {
downloadedPath = match[1]
}
}
}
if _, err := os.Stat(downloadedPath); err != nil {
cancelFunc()
return nil, additionalBuiltinConfig, fmt.Errorf("failed to download maven artifact to path %s - %w", downloadedPath, err)
Expand Down
4 changes: 2 additions & 2 deletions external-providers/yq-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/bombsimon/logrusr/v3 v3.1.0
github.com/go-logr/logr v1.2.4
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd
github.com/sirupsen/logrus v1.9.3
github.com/swaggest/openapi-go v0.2.45
go.lsp.dev/uri v0.3.0
Expand Down Expand Up @@ -34,7 +34,7 @@ require (
go.opentelemetry.io/otel/trace v1.11.2 // indirect
golang.org/x/mod v0.8.0
golang.org/x/net v0.22.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 // indirect
)
8 changes: 4 additions & 4 deletions external-providers/yq-external-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59 h1:ybaunU+d9G4yMU2rhYVmO624QupG5JjiOA1rNCMh38o=
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1.0.20240520232004-8af6f5c84a59/go.mod h1:GXkSykQ84oE1SyMvFko9s9wRn/FMdl4efLLWSjMX2nU=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd h1:mDu+2r8AIDxoIQ8UrGFT3AYygPBZFfQOVL3YfJIPkMw=
github.com/konveyor/analyzer-lsp v0.5.0-rc.1.0.20240729200152-daea76a602fd/go.mod h1:Gqj6MRUA2Jjjw19tUguJB6Bqj4dLwZzb68FmAUok0ac=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
Expand Down Expand Up @@ -66,8 +66,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down

0 comments on commit f3fcedd

Please sign in to comment.