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

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


The following commit(s) were added to refs/heads/main by this push:
     new cc437c72c92 CAMEL-19876: camel-jbang - Add maven-settings to 
camel-jbang export command
cc437c72c92 is described below

commit cc437c72c927f98f0d90453e09373dd966cc3dda
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri Sep 22 07:13:57 2023 +0200

    CAMEL-19876: camel-jbang - Add maven-settings to camel-jbang export command
---
 .../java/org/apache/camel/dsl/jbang/core/commands/Export.java    | 7 ++++++-
 .../apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java  | 9 +++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java
index 1b0c4a1f7b0..6e10b059c92 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Export.java
@@ -35,11 +35,11 @@ public class Export extends ExportBaseCommand {
 
     @Override
     protected Integer export() throws Exception {
-        // read runtime and gav from profile if not configured
         File profile = new File(getProfile() + ".properties");
         if (profile.exists()) {
             Properties prop = new CamelCaseOrderedProperties();
             RuntimeUtil.loadProperties(prop, profile);
+            // read runtime and gav from profile if not configured
             if (this.runtime == null) {
                 this.runtime = prop.getProperty("camel.jbang.runtime");
             }
@@ -67,6 +67,9 @@ public class Export extends ExportBaseCommand {
             this.secretsRefreshProviders
                     = prop.getProperty("camel.jbang.secretsRefreshProviders", 
this.secretsRefreshProviders);
             this.openapi = prop.getProperty("camel.jbang.openApi", 
this.openapi);
+            this.repos = prop.getProperty("camel.jbang.repos", this.repos);
+            this.mavenSettings = 
prop.getProperty("camel.jbang.maven-settings", this.mavenSettings);
+            this.mavenSettingsSecurity = 
prop.getProperty("camel.jbang.maven-settings-security", 
this.mavenSettingsSecurity);
         }
 
         if (runtime == null) {
@@ -98,6 +101,8 @@ public class Export extends ExportBaseCommand {
         cmd.dependencies = this.dependencies;
         cmd.runtime = this.runtime;
         cmd.gav = this.gav;
+        cmd.mavenSettings = this.mavenSettings;
+        cmd.mavenSettingsSecurity = this.mavenSettingsSecurity;
         cmd.exportDir = this.exportDir;
         cmd.fresh = this.fresh;
         cmd.javaVersion = this.javaVersion;
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
index c8054a0c2b3..01426fea74f 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
@@ -96,6 +96,15 @@ abstract class ExportBaseCommand extends CamelCommand {
     @CommandLine.Option(names = { "--gav" }, description = "The Maven 
group:artifact:version")
     protected String gav;
 
+    @CommandLine.Option(names = { "--maven-settings" },
+                        description = "Optional location of maven setting.xml 
file to configure servers, repositories, mirrors and proxies."
+                                      + " If set to \"false\", not even the 
default ~/.m2/settings.xml will be used.")
+    String mavenSettings;
+
+    @CommandLine.Option(names = { "--maven-settings-security" },
+                        description = "Optional location of maven 
settings-security.xml file to decrypt settings.xml")
+    String mavenSettingsSecurity;
+
     @CommandLine.Option(names = { "--main-classname" },
                         description = "The class name of the Camel Main 
application class",
                         defaultValue = "CamelApplication")

Reply via email to