Skip to content

Commit

Permalink
fix(#3956): Add maven settings-security to maven command
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer authored and squakez committed Mar 3, 2023
1 parent 46717db commit 18161e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/util/maven/maven_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ func (c *Command) Do(ctx context.Context) error {
args = append(args, "--settings", settingsPath)
}

settingsSecurityPath := filepath.Join(c.context.Path, "settings-security.xml")
if settingsSecurityExists, err := util.FileExists(settingsSecurityPath); err != nil {
return err
} else if settingsSecurityExists {
args = append(args, "-Dsettings.security="+settingsSecurityPath)
}

if !util.StringContainsPrefix(c.context.AdditionalArguments, "-Dmaven.artifact.threads") {
args = append(args, "-Dmaven.artifact.threads="+strconv.Itoa(runtime.GOMAXPROCS(0)))
}
Expand Down

0 comments on commit 18161e9

Please sign in to comment.