Skip to content

Commit

Permalink
2673 - Recursively search for .mvn dir
Browse files Browse the repository at this point in the history
  • Loading branch information
galusben committed Sep 29, 2024
1 parent e7ec399 commit 6408b43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions utils/mvn/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-cli-core/v2/utils/dependencies"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/io/fileutils"
"github.com/spf13/viper"
)

Expand Down Expand Up @@ -102,6 +103,13 @@ func RunMvn(mu *MvnUtils) error {
if v, ok := props["buildInfoConfig.artifactoryResolutionEnabled"]; ok {
mvnOpts = append(mvnOpts, "-DbuildInfoConfig.artifactoryResolutionEnabled="+v)
}
projectRoot, exists, err := fileutils.FindUpstream(".mvn", fileutils.Dir)
if err != nil {
return errorutils.CheckError(err)
}
if !exists {
projectRoot = ""
}
dependencyLocalPath, err := getMavenDependencyLocalPath()
if err != nil {
return err
Expand All @@ -114,6 +122,7 @@ func RunMvn(mu *MvnUtils) error {
useWrapper).
SetOutputWriter(mu.outputWriter)
mavenModule.SetMavenOpts(mvnOpts...)
mavenModule.SetMavenRootDir(projectRoot)

Check failure on line 125 in utils/mvn/utils.go

View workflow job for this annotation

GitHub Actions / Go-Sec

mavenModule.SetMavenRootDir undefined (type *"github.com/jfrog/build-info-go/build".MavenModule has no field or method SetMavenRootDir)

Check failure on line 125 in utils/mvn/utils.go

View workflow job for this annotation

GitHub Actions / Static-Check

mavenModule.SetMavenRootDir undefined (type *"github.com/jfrog/build-info-go/build".MavenModule has no field or method SetMavenRootDir) (typecheck)

Check failure on line 125 in utils/mvn/utils.go

View workflow job for this annotation

GitHub Actions / Static-Check

mavenModule.SetMavenRootDir undefined (type *"github.com/jfrog/build-info-go/build".MavenModule has no field or method SetMavenRootDir)) (typecheck)
if err = coreutils.ConvertExitCodeError(mavenModule.CalcDependencies()); err != nil {
return err
}
Expand Down

0 comments on commit 6408b43

Please sign in to comment.