Skip to content

Commit 290121a

Browse files
authored
🐛 Fix bug to use Maven wrapper when DepTreeParams.UseWrapper is true (jfrog#420)
1 parent 28c8313 commit 290121a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

commands/audit/sca/java/mvn.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,13 @@ func (mdt *MavenDepTreeManager) RunMvnCmd(goals []string) (cmdOutput []byte, err
174174
}
175175

176176
//#nosec G204
177-
cmdOutput, err = exec.Command("mvn", goals...).CombinedOutput()
177+
// Fix bug #418 if DepTreeParams.UseWrapper is true, we need to run the maven wrapper script instead of 'mvn'
178+
cmd := "mvn"
179+
if mdt.useWrapper {
180+
cmd = "./mvnw"
181+
}
182+
//#nosec G204
183+
cmdOutput, err = exec.Command(cmd, goals...).CombinedOutput()
178184
if err != nil {
179185
stringOutput := string(cmdOutput)
180186
if len(cmdOutput) > 0 {

0 commit comments

Comments
 (0)