You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/03/06 08:37:15 UTC

[camel-k] branch release-1.12.x updated: fix(#3956): Add maven settings-security to maven command

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

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


The following commit(s) were added to refs/heads/release-1.12.x by this push:
     new 620778fe1 fix(#3956): Add maven settings-security to maven command
620778fe1 is described below

commit 620778fe18b969e04685692e5d63ef559ca181f2
Author: Gaelle Fournier <ga...@gmail.com>
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)))
 	}