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 2023/08/03 19:10:23 UTC
[camel] 01/02: CAMEL-19710: camel-jbang - Run should compile java to default package if project has GAV
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch run-gav
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 61e77cf77340e7c09bb6974366b6a3a7c4d04a00
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 3 21:08:03 2023 +0200
CAMEL-19710: camel-jbang - Run should compile java to default package if project has GAV
---
.../main/java/org/apache/camel/dsl/support/SourceLoader.java | 11 +++++++++++
.../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dsl/camel-dsl-support/src/main/java/org/apache/camel/dsl/support/SourceLoader.java b/dsl/camel-dsl-support/src/main/java/org/apache/camel/dsl/support/SourceLoader.java
index f76724d44cd..0983d1ca695 100644
--- a/dsl/camel-dsl-support/src/main/java/org/apache/camel/dsl/support/SourceLoader.java
+++ b/dsl/camel-dsl-support/src/main/java/org/apache/camel/dsl/support/SourceLoader.java
@@ -22,9 +22,20 @@ import java.io.IOException;
/**
* Loader for loading the source code from {@link Resource}.
+ *
+ * Custom {@link SourceLoader} implementations can be plugged into the {@link org.apache.camel.CamelContext} by
+ * adding to the {@link org.apache.camel.spi.Registry}.
*/
public interface SourceLoader {
+ /**
+ * Loads the source from the given resource
+ *
+ * @param resource the resource
+ * @return the source code (such as java, xml, groovy, yaml)
+ *
+ * @throws IOException is thrown if error loading the source
+ */
String loadResource(Resource resource) throws IOException;
}
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 bef15d1ecd3..e8f0ca92555 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
@@ -141,7 +141,7 @@ public class Run extends CamelCommand {
description = "Additional maven repositories for download on-demand (Use commas to separate multiple repositories)")
String repos;
- @CommandLine.Option(names = { "--gav" }, description = "The Maven group:artifact:version")
+ @Option(names = { "--gav" }, description = "The Maven group:artifact:version (used during exporting)")
String gav;
@Option(names = { "--maven-settings" },