You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/11/10 06:35:49 UTC
[camel] 01/02: camel-jbang - Polished maven settings options
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
commit 6c4d2d0aac5a626bc57056bfb95e3219a4aead37
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Nov 10 07:30:28 2022 +0100
camel-jbang - Polished maven settings options
---
docs/user-manual/modules/ROOT/pages/camel-jbang.adoc | 11 +++++++----
.../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 6 ++++--
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
index f595ce268fe..f4c2df60ec5 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc
@@ -226,7 +226,7 @@ Camel will download these JARs in the following order:
2. from internet in Maven Central
3. from internet in custom 3rd-party Maven repositories
4. from all the repositories found in active profiles of `~/.m2/settings.xml` or a settings file specified using
-`--settings` option.
+`--maven-settings` option.
If you do not want Camel JBang to download over the internet, you can turn this off with `--download`, as shown below:
@@ -317,6 +317,7 @@ encrypted) or active profiles and additional repositories.
Maven repositories can use authentication and the Maven-way to configure credentials is through `<server>` elements,
like this:
+
[source,xml]
----
<server>
@@ -338,6 +339,7 @@ Master password: camel
----
The above password should be added to `~/.m2/settings-security.xml` file like this:
+
[source,xml]
----
<settingsSecurity>
@@ -346,6 +348,7 @@ The above password should be added to `~/.m2/settings-security.xml` file like th
----
Then a normal password can be configured like this:
+
[source,bash]
----
$ mvn -ep
@@ -354,21 +357,21 @@ Password: camel
{SSVqy/PexxQHvubrWhdguYuG7HnTvHlaNr6g3dJn7nk=}
----
-Finally such password can be used in `<server>/<password>` configuration.
+Finally, such password can be used in `<server>/<password>` configuration.
By default, Maven reads the master password from `~/.m2/settings-security.xml` file, but we can override it.
Location of the settings.xml file itself can be specified as well:
[source,bash]
----
-camel run foo.java --settings=/path/to/settings.xml --settings-security=/path/to/settings-security.xml
+camel run foo.java --maven-settings=/path/to/settings.xml --maven-settings-security=/path/to/settings-security.xml
----
If you want to run Camel application without assuming any location (even `~/.m2/settings.xml`), use this option:
[source,bash]
----
-camel run foo.java --settings=false
+camel run foo.java --maven-settings=false
----
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index aede235c11d..dfccbb856ff 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -104,11 +104,11 @@ class Run extends CamelCommand {
@Option(names = {"--repos"}, description = "Additional maven repositories for download on-demand (Use commas to separate multiple repositories)")
String repos;
- @Option(names = {"--settings"}, description = "Optional location of maven setting.xml file to configure servers, repositories, mirrors and proxies." +
+ @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;
- @Option(names = {"--settings-security"}, description = "Optional location of maven settings-security.xml file to decrypt settings.xml")
+ @Option(names = {"--maven-settings-security"}, description = "Optional location of maven settings-security.xml file to decrypt settings.xml")
String mavenSettingsSecurity;
@Option(names = { "--fresh" }, description = "Make sure we use fresh (i.e. non-cached) resources")
@@ -274,6 +274,8 @@ class Run extends CamelCommand {
propertiesFiles = propertiesFiles + ",file:" + profilePropertiesFile.getName();
}
repos = profileProperties.getProperty("camel.jbang.repos", repos);
+ mavenSettings = profileProperties.getProperty("camel.jbang.maven-settings", mavenSettings);
+ mavenSettingsSecurity = profileProperties.getProperty("camel.jbang.maven-settings-security", mavenSettingsSecurity);
openapi = profileProperties.getProperty("camel.jbang.openApi", openapi);
download = "true".equals(profileProperties.getProperty("camel.jbang.download", download ? "true" : "false"));
}