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 8c3a5f06d53 CAMEL-22079: camel-dsl-modeline: Remove deprecated camel-k
specific modelines
8c3a5f06d53 is described below
commit 8c3a5f06d534b792e3b7492b0367724cf729f9ef
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun May 18 10:17:39 2025 +0200
CAMEL-22079: camel-dsl-modeline: Remove deprecated camel-k specific
modelines
---
.../catalog/main/camel-main-configuration-metadata.json | 2 +-
.../src/main/java/org/apache/camel/CamelContext.java | 8 ++------
.../META-INF/camel-main-configuration-metadata.json | 2 +-
core/camel-main/src/main/docs/main.adoc | 2 +-
.../apache/camel/main/DefaultConfigurationProperties.java | 13 +++++--------
.../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 4 +++-
6 files changed, 13 insertions(+), 18 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index dc418df3bde..6435a1d6bcc 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -94,7 +94,7 @@
{ "name": "camel.main.mainListeners", "description": "Sets main listener
objects that will be used for MainListener that makes it possible to do custom
logic during starting and stopping camel-main.", "sourceType":
"org.apache.camel.main.MainConfigurationProperties", "type": "object",
"javaType": "java.util.List" },
{ "name": "camel.main.mdcLoggingKeysPattern", "description": "Sets the
pattern used for determine which custom MDC keys to propagate during message
routing when the routing engine continues routing asynchronously for the given
message. Setting this pattern to will propagate all custom keys. Or setting the
pattern to foo,bar will propagate any keys starting with either foo or bar.
Notice that a set of standard Camel MDC keys are always propagated which starts
with camel. as key name. [...]
{ "name": "camel.main.messageHistory", "description": "Sets whether
message history is enabled or not. Default is false.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": "false" },
- { "name": "camel.main.modeline", "description": "Whether camel-k style
modeline is also enabled when not using camel-k. Enabling this allows to use a
camel-k like experience by being able to configure various settings using
modeline directly in your route source code.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": "false", "deprecated": true },
+ { "name": "camel.main.modeline", "description": "Whether to support JBang
style \/\/DEPS to specify additional dependencies when running Camel JBang",
"sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type":
"boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.main.name", "description": "Sets the name of the
CamelContext.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string",
"javaType": "java.lang.String" },
{ "name": "camel.main.producerTemplateCacheSize", "description": "Producer
template endpoints cache size.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "integer",
"javaType": "int", "defaultValue": 1000 },
{ "name": "camel.main.profile", "description": "Camel profile to use when
running. The dev profile is for development, which enables a set of additional
developer focus functionality, tracing, debugging, and gathering additional
runtime statistics that are useful during development. However, those
additional features has a slight overhead cost, and are not enabled for
production profile. The default profile is prod.", "sourceType":
"org.apache.camel.main.MainConfigurationProperties", [...]
diff --git a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
index 7e26ecca707..2911a3f8755 100644
--- a/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
+++ b/core/camel-api/src/main/java/org/apache/camel/CamelContext.java
@@ -1344,17 +1344,13 @@ public interface CamelContext extends
CamelContextLifecycle, RuntimeConfiguratio
void setSourceLocationEnabled(Boolean sourceLocationEnabled);
/**
- * Whether camel-k style modeline is also enabled when not using camel-k.
Enabling this allows to use a camel-k like
- * experience by being able to configure various settings using modeline
directly in your route source code.
+ * Whether to support JBang style //DEPS to specify additional
dependencies when running Camel JBang
*/
- @Deprecated(since = "4.10")
Boolean isModeline();
/**
- * Whether camel-k style modeline is also enabled when not using camel-k.
Enabling this allows to use a camel-k like
- * experience by being able to configure various settings using modeline
directly in your route source code.
+ * Whether to support JBang style //DEPS to specify additional
dependencies when running Camel JBang
*/
- @Deprecated(since = "4.10")
void setModeline(Boolean modeline);
/**
diff --git
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index dc418df3bde..6435a1d6bcc 100644
---
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -94,7 +94,7 @@
{ "name": "camel.main.mainListeners", "description": "Sets main listener
objects that will be used for MainListener that makes it possible to do custom
logic during starting and stopping camel-main.", "sourceType":
"org.apache.camel.main.MainConfigurationProperties", "type": "object",
"javaType": "java.util.List" },
{ "name": "camel.main.mdcLoggingKeysPattern", "description": "Sets the
pattern used for determine which custom MDC keys to propagate during message
routing when the routing engine continues routing asynchronously for the given
message. Setting this pattern to will propagate all custom keys. Or setting the
pattern to foo,bar will propagate any keys starting with either foo or bar.
Notice that a set of standard Camel MDC keys are always propagated which starts
with camel. as key name. [...]
{ "name": "camel.main.messageHistory", "description": "Sets whether
message history is enabled or not. Default is false.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": "false" },
- { "name": "camel.main.modeline", "description": "Whether camel-k style
modeline is also enabled when not using camel-k. Enabling this allows to use a
camel-k like experience by being able to configure various settings using
modeline directly in your route source code.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": "false", "deprecated": true },
+ { "name": "camel.main.modeline", "description": "Whether to support JBang
style \/\/DEPS to specify additional dependencies when running Camel JBang",
"sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type":
"boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.main.name", "description": "Sets the name of the
CamelContext.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string",
"javaType": "java.lang.String" },
{ "name": "camel.main.producerTemplateCacheSize", "description": "Producer
template endpoints cache size.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "integer",
"javaType": "int", "defaultValue": 1000 },
{ "name": "camel.main.profile", "description": "Camel profile to use when
running. The dev profile is for development, which enables a set of additional
developer focus functionality, tracing, debugging, and gathering additional
runtime statistics that are useful during development. However, those
additional features has a slight overhead cost, and are not enabled for
production profile. The default profile is prod.", "sourceType":
"org.apache.camel.main.MainConfigurationProperties", [...]
diff --git a/core/camel-main/src/main/docs/main.adoc
b/core/camel-main/src/main/docs/main.adoc
index bc3e67f0a21..75097722a2d 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -91,7 +91,7 @@ The camel.main supports 122 options, which are listed below.
| *camel.main.mainListeners* | Sets main listener objects that will be used
for MainListener that makes it possible to do custom logic during starting and
stopping camel-main. | | List
| *camel.main.mdcLoggingKeys{zwsp}Pattern* | Sets the pattern used for
determine which custom MDC keys to propagate during message routing when the
routing engine continues routing asynchronously for the given message. Setting
this pattern to will propagate all custom keys. Or setting the pattern to
foo,bar will propagate any keys starting with either foo or bar. Notice that a
set of standard Camel MDC keys are always propagated which starts with camel.
as key name. The match rules are a [...]
| *camel.main.messageHistory* | Sets whether message history is enabled or
not. Default is false. | false | boolean
-| *camel.main.modeline* | Whether camel-k style modeline is also enabled when
not using camel-k. Enabling this allows to use a camel-k like experience by
being able to configure various settings using modeline directly in your route
source code. | false | boolean
+| *camel.main.modeline* | Whether to support JBang style //DEPS to specify
additional dependencies when running Camel JBang | false | boolean
| *camel.main.name* | Sets the name of the CamelContext. | | String
| *camel.main.producerTemplate{zwsp}CacheSize* | Producer template endpoints
cache size. | 1000 | int
| *camel.main.profile* | Camel profile to use when running. The dev profile is
for development, which enables a set of additional developer focus
functionality, tracing, debugging, and gathering additional runtime statistics
that are useful during development. However, those additional features has a
slight overhead cost, and are not enabled for production profile. The default
profile is prod. | | String
diff --git
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index c489c7b6c83..d3658ccef79 100644
---
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -56,7 +56,6 @@ public abstract class DefaultConfigurationProperties<T> {
private boolean loadTypeConverters;
private boolean loadHealthChecks;
private boolean devConsoleEnabled;
- @Deprecated(since = "4.10")
private boolean modeline;
private int logDebugMaxChars;
private boolean streamCachingEnabled = true;
@@ -415,16 +414,16 @@ public abstract class DefaultConfigurationProperties<T> {
this.devConsoleEnabled = devConsoleEnabled;
}
- @Deprecated(since = "4.10")
+ /**
+ * Whether to support JBang style //DEPS to specify additional
dependencies when running Camel JBang
+ */
public boolean isModeline() {
return modeline;
}
/**
- * Whether camel-k style modeline is also enabled when not using camel-k.
Enabling this allows to use a camel-k like
- * experience by being able to configure various settings using modeline
directly in your route source code.
+ * Whether to support JBang style //DEPS to specify additional
dependencies when running Camel JBang
*/
- @Deprecated(since = "4.10")
public void setModeline(boolean modeline) {
this.modeline = modeline;
}
@@ -1806,10 +1805,8 @@ public abstract class DefaultConfigurationProperties<T> {
}
/**
- * Whether camel-k style modeline is also enabled when not using camel-k.
Enabling this allows to use a camel-k like
- * experience by being able to configure various settings using modeline
directly in your route source code.
+ * Whether to support JBang style //DEPS to specify additional
dependencies when running Camel JBang
*/
- @Deprecated
public T withModeline(boolean modeline) {
this.modeline = modeline;
return (T) this;
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 f6b8835ac74..27e14f08fd7 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
@@ -308,7 +308,7 @@ public class Run extends CamelCommand {
boolean observe;
@Option(names = { "--modeline" }, defaultValue = "true",
- description = "Deprecated, to be removed: Enables Camel-K style
modeline")
+ description = "Whether to support JBang style //DEPS to specify
additional dependencies")
boolean modeline = true;
@Option(names = { "--open-api" }, description = "Adds an OpenAPI spec from
the given file (json or yaml file)")
@@ -614,6 +614,8 @@ public class Run extends CamelCommand {
}
if (modeline) {
writeSetting(main, profileProperties, "camel.main.modeline",
"true");
+ // configure eager
+ main.configure().withModeline(true);
}
if (ignoreLoadingError) {
writeSetting(main, profileProperties,
"camel.jbang.ignoreLoadingError", "true");