From c8b1cc497f5ab5fc756d94ee4a421ac0eddea29c Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Fri, 3 Mar 2023 13:25:01 +0100 Subject: [PATCH] fix(#3956): Add maven settings-security to maven command --- pkg/util/maven/maven_command.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/util/maven/maven_command.go b/pkg/util/maven/maven_command.go index c0cc4d7647..97049d5eb3 100644 --- a/pkg/util/maven/maven_command.go +++ b/pkg/util/maven/maven_command.go @@ -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))) }