This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new 18161e96f fix(#3956): Add maven settings-security to maven command
18161e96f is described below

commit 18161e96fde9287b7b7cc4f7793389fa2c742a20
Author: Gaelle Fournier <[email protected]>
AuthorDate: Fri Mar 3 13:25:01 2023 +0100

    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 c0cc4d764..97049d5eb 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)))
        }

Reply via email to