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

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

commit 1df033fa2a814ce31af52aaae0476bb179e6feff
Author: Croway <[email protected]>
AuthorDate: Wed Apr 8 11:06:22 2026 +0200

    CAMEL-23276: Fix Javadoc and protect files list from mutation
---
 .../java/org/apache/camel/dsl/jbang/core/commands/Run.java   |  5 +++--
 .../java/org/apache/camel/dsl/jbang/core/common/Plugin.java  |  3 ++-
 .../camel/dsl/jbang/core/common/PluginRunCustomizer.java     | 12 ++++++------
 3 files changed, 11 insertions(+), 9 deletions(-)

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 f2355a91497a..5291627fe962 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
@@ -972,9 +972,10 @@ public class Run extends CamelCommand {
             activePlugins = PluginHelper.getActivePlugins(getMain(), 
repositories);
 
             // Let plugins customize the run environment (e.g., set config 
directories)
-            // before dependency resolution, so plugin exporters can scan the 
right locations
+            // before plugin exporter dependencies are added, so exporters can 
scan the right locations
             for (Plugin plugin : activePlugins.values()) {
-                plugin.getRunCustomizer().ifPresent(customizer -> 
customizer.beforeRun(main, files));
+                plugin.getRunCustomizer()
+                        .ifPresent(customizer -> customizer.beforeRun(main, 
Collections.unmodifiableList(files)));
             }
 
             Set<PluginExporter> exporters = activePlugins.values()
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/Plugin.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/Plugin.java
index 8571418b5f2d..79e5f371973a 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/Plugin.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/Plugin.java
@@ -45,7 +45,8 @@ public interface Plugin {
 
     /**
      * The plugin may provide an optional run customizer that is called after 
the Run command has resolved file
-     * arguments and configured dependencies, but before KameletMain.run() 
builds the CamelContext.
+     * arguments and basic dependencies, but before plugin exporter 
dependencies are added and KameletMain.run() builds
+     * the CamelContext.
      *
      * @return the plugin specific run customizer implementation, otherwise 
empty
      */
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginRunCustomizer.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginRunCustomizer.java
index b0c64f653324..436cffd199f9 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginRunCustomizer.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginRunCustomizer.java
@@ -21,20 +21,20 @@ import java.util.List;
 import org.apache.camel.main.KameletMain;
 
 /**
- * Plugin hook that runs after the Run command has resolved file arguments and 
configured dependencies, but before
- * {@link KameletMain#run()} builds the CamelContext.
+ * Plugin hook that runs after the Run command has resolved file arguments and 
basic dependencies, but before plugin
+ * exporter dependencies are added and {@link KameletMain#run()} builds the 
CamelContext.
  *
  * This allows plugins to customize the environment (system properties, config 
directories, initial properties) based on
- * the file arguments passed to the run command.
+ * the file arguments passed to the run command, so that plugin exporters can 
scan the right locations.
  */
 public interface PluginRunCustomizer {
 
     /**
-     * Called after the Run command has resolved file arguments and configured 
dependencies, but before
-     * KameletMain.run() builds the CamelContext.
+     * Called after the Run command has resolved file arguments and basic 
dependencies, but before plugin exporter
+     * dependencies are added and KameletMain.run() builds the CamelContext.
      *
      * @param main  the KameletMain instance (for adding initial properties)
-     * @param files the resolved file arguments passed to the run command
+     * @param files the resolved file arguments passed to the run command 
(read-only)
      */
     void beforeRun(KameletMain main, List<String> files);
 }

Reply via email to