Skip to content

Commit

Permalink
Fix changes at Mvn handler (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas authored Feb 14, 2024
1 parent 207f42f commit 0574b9d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
)

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 dev
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240213075115-4bf1fe83505d

// replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security dev
replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.0.2-0.20240214091334-d8ecf2a2cf76

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go dev

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,10 @@ github.com/jfrog/gofrog v1.5.1 h1:2AXL8hHu1jJFMIoCqTp2OyRUfEqEp4nC7J8fwn6KtwE=
github.com/jfrog/gofrog v1.5.1/go.mod h1:SZ1EPJUruxrVGndOzHd+LTiwWYKMlHqhKD+eu+v5Hqg=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-core/v2 v2.47.12 h1:xsEVdzbdhNGkI8Ey4Othx5+zpgCMnT99Uy71LOn+Q7k=
github.com/jfrog/jfrog-cli-core/v2 v2.47.12/go.mod h1:RVn4pIkR5fPUnr8gFXt61ou3pCNrrDdRQUpcolP4lhw=
github.com/jfrog/jfrog-cli-security v1.0.1 h1:zSyqM+E4QP1GItVYO+JnOCRC/65yV+hWH5BmqOJ+sEE=
github.com/jfrog/jfrog-cli-security v1.0.1/go.mod h1:EH7WtHS6Lg3NCQ3wBcrQ2tjAN9O+4whEW48A20bYq0k=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240213075115-4bf1fe83505d h1:9efTE8NyZV6XtF9XoGq0g3XiEIYjCPdiHVEanxhhnlk=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240213075115-4bf1fe83505d/go.mod h1:+eraSKhahQf7tj09+g3rAA2Z+XPnZGfMc0y8uUDecZw=
github.com/jfrog/jfrog-cli-security v1.0.2-0.20240214091334-d8ecf2a2cf76 h1:VK5FPJgi1OpWxTvUyAzqyO6a1NSX0sjvQ1K5zwgXGUY=
github.com/jfrog/jfrog-cli-security v1.0.2-0.20240214091334-d8ecf2a2cf76/go.mod h1:39Y1SHOpaG8iNTEgBhRqaUBKHaiYrZ5Joa6OwPCFQ64=
github.com/jfrog/jfrog-client-go v1.36.1 h1:22Ucy5XdEP1yHEjbN8zOt2dZys5rbwcwhC3l3pcOdf4=
github.com/jfrog/jfrog-client-go v1.36.1/go.mod h1:y1WF6eiZ7V2DortiwjpMEicEH6NIJH+hOXI5QI2W3NU=
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA=
Expand Down
7 changes: 4 additions & 3 deletions packagehandlers/mavenpackagehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ type pomDependencyDetails struct {

func NewMavenPackageHandler(scanDetails *utils.ScanDetails) *MavenPackageHandler {
depTreeParams := &java.DepTreeParams{
Server: scanDetails.ServerDetails,
DepsRepo: scanDetails.DepsRepo,
Server: scanDetails.ServerDetails,
DepsRepo: scanDetails.DepsRepo,
IsMavenDepTreeInstalled: true,
}
// The mvn-dep-tree plugin has already been installed during the audit dependency tree build phase,
// Therefore, we set the `isDepTreeInstalled` flag to true
mavenDepTreeManager := java.NewMavenDepTreeManager(depTreeParams, java.Projects, true)
mavenDepTreeManager := java.NewMavenDepTreeManager(depTreeParams, java.Projects)
return &MavenPackageHandler{MavenDepTreeManager: mavenDepTreeManager}
}

Expand Down
2 changes: 1 addition & 1 deletion packagehandlers/packagehandlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ func TestGetDependenciesFromDependencyManagement(t *testing.T) {
}

func TestGetProjectPoms(t *testing.T) {
mvnHandler := &MavenPackageHandler{MavenDepTreeManager: java.NewMavenDepTreeManager(&java.DepTreeParams{}, java.Projects, false)}
mvnHandler := &MavenPackageHandler{MavenDepTreeManager: java.NewMavenDepTreeManager(&java.DepTreeParams{IsMavenDepTreeInstalled: false}, java.Projects)}
currDir, err := os.Getwd()
assert.NoError(t, err)
tmpDir, err := os.MkdirTemp("", "")
Expand Down

0 comments on commit 0574b9d

Please sign in to comment.