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 56dfb8b  CAMEL-16671: camel-maven-plugin - Detect if kamelet-main is 
on classpath and use KameletMain as main class
56dfb8b is described below

commit 56dfb8b3ec77c3b1113a214a9a790880e014369d
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon May 31 10:13:06 2021 +0200

    CAMEL-16671: camel-maven-plugin - Detect if kamelet-main is on classpath 
and use KameletMain as main class
---
 .../src/main/java/org/apache/camel/maven/RunMojo.java                | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
 
b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
index 0456925..7eca7c4 100644
--- 
a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
+++ 
b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
@@ -407,6 +407,7 @@ public class RunMojo extends AbstractExecMojo {
                 args.add("-pf");
                 args.add(configAdminFileName);
             }
+            extraPluginDependencyArtifactId = "camel-blueprint-main";
             getLog().info("Using org.apache.camel.blueprint.Main to initiate a 
CamelContext");
         } else if (usingKameletMain) {
             mainClass = "org.apache.camel.main.KameletMain";
@@ -445,6 +446,10 @@ public class RunMojo extends AbstractExecMojo {
             throw new MojoFailureException(
                     "Cannot run OSGi Blueprint Main because 
camel-blueprint-main JAR is not available on classpath");
         }
+        if (usingKameletMain && !detectKameletOnClassPath()) {
+            throw new MojoFailureException(
+                    "Cannot run Kamelet Main because camel-kamelet-main JAR is 
not available on classpath");
+        }
 
         final Thread bootstrapThread = new Thread(threadGroup, new Runnable() {
             public void run() {

Reply via email to