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 2020/03/24 16:41:59 UTC

[camel] branch master updated (4751665 -> 2c1609f)

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

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 4751665  Camel-CXF-Transport: Removed camel-blueprint refs from the POM
     new dfbb53a  CAMEL-14776: came:run with osgi blueprint updated after osgi moved to camel-karaf repo
     new 2c1609f  CAMEL-14776: Update upg guide

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/ROOT/pages/camel-3x-upgrade-guide.adoc | 11 ++++++++-
 tooling/maven/camel-maven-plugin/pom.xml           |  5 -----
 .../main/java/org/apache/camel/maven/RunMojo.java  | 26 +++++++++++++++++-----
 3 files changed, 30 insertions(+), 12 deletions(-)


[camel] 02/02: CAMEL-14776: Update upg guide

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2c1609f8311eeef203496ec2294b1a6bfae5f09c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Mar 24 17:40:24 2020 +0100

    CAMEL-14776: Update upg guide
---
 .../modules/ROOT/pages/camel-3x-upgrade-guide.adoc            | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc
index 2eee31a..90e5f3d 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc
@@ -813,7 +813,16 @@ from("timer:foo?period=5000")
 
 === Main in camel-spring
 
-The `org.apache.camel.spring.Main` class has been moved out of `camel-spring` JAR into its own JAR named `camel-spring-main`.
+The `org.apache.camel.spring.Main` class has been moved out of `camel-spring` JAR into its own
+JAR named `camel-spring-main`.
+
+=== Main in camel-test-blueprint
+
+The `org.apache.camel.test.blueprint.Main` class has been renamed to `org.apache.camel.test.blueprint.Main`
+and moved into its own `camel-test-blueprint` JAR.
+
+To use the camel-maven-plugin goal `camel:run` with OSGi plugin, you now need to add the following dependency
+to the classpath `org.apache.camel.karaf:camel-blueprint-main`.
 
 === API changes
 


[camel] 01/02: CAMEL-14776: came:run with osgi blueprint updated after osgi moved to camel-karaf repo

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit dfbb53a693a853992c83b560e513e069062c620e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Mar 24 17:38:26 2020 +0100

    CAMEL-14776: came:run with osgi blueprint updated after osgi moved to camel-karaf repo
---
 tooling/maven/camel-maven-plugin/pom.xml           |  5 -----
 .../main/java/org/apache/camel/maven/RunMojo.java  | 26 +++++++++++++++++-----
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/tooling/maven/camel-maven-plugin/pom.xml b/tooling/maven/camel-maven-plugin/pom.xml
index dac5ab7..75b7758 100644
--- a/tooling/maven/camel-maven-plugin/pom.xml
+++ b/tooling/maven/camel-maven-plugin/pom.xml
@@ -86,11 +86,6 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-spring-javaconfig</artifactId>
         </dependency>
-        <!-- camel-test-blueprint has Main class for running blueprint out of container -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test-blueprint</artifactId>
-        </dependency>
         <!-- camel-cdi has Main class for running CDI -->
         <dependency>
             <groupId>org.apache.camel</groupId>
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 41fe6ab..93e364f 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
@@ -314,7 +314,7 @@ public class RunMojo extends AbstractExecMojo {
     private Properties originalSystemProperties;
 
     private String extraPluginDependencyArtifactId;
-    
+
 
     /**
      * Execute goal.
@@ -405,9 +405,7 @@ public class RunMojo extends AbstractExecMojo {
             extraPluginDependencyArtifactId = "camel-cdi";
             getLog().info("Using " + mainClass + " to initiate a CamelContext");
         } else if (usingBlueprintMain) {
-            mainClass = "org.apache.camel.test.blueprint.Main";
-            // must include plugin dependencies for blueprint
-            extraPluginDependencyArtifactId = "camel-test-blueprint";
+            mainClass = "org.apache.camel.blueprint.Main";
             // set the configAdmin pid
             if (configAdminPid != null) {
                 args.add("-pid");
@@ -418,7 +416,7 @@ public class RunMojo extends AbstractExecMojo {
                 args.add("-pf");
                 args.add(configAdminFileName);
             }
-            getLog().info("Using org.apache.camel.test.blueprint.Main to initiate a CamelContext");
+            getLog().info("Using org.apache.camel.blueprint.Main to initiate a CamelContext");
         } else if (mainClass != null) {
             getLog().info("Using custom " + mainClass + " to initiate a CamelContext");
         } else {
@@ -446,6 +444,11 @@ public class RunMojo extends AbstractExecMojo {
 
         final ClassLoader loader = getClassLoader();
         IsolatedThreadGroup threadGroup = new IsolatedThreadGroup(mainClass /* name */);
+
+        if (!detectBlueprintMainOnClassPath()) {
+            throw new MojoFailureException("Cannot run OSGi Blueprint Main because camel-blueprint-main JAR is not available on classpath");
+        }
+
         final Thread bootstrapThread = new Thread(threadGroup, new Runnable() {
             public void run() {
                 try {
@@ -702,6 +705,18 @@ public class RunMojo extends AbstractExecMojo {
         return false;
     }
 
+    @SuppressWarnings("unchecked")
+    private boolean detectBlueprintMainOnClassPath() {
+        List<Dependency> deps = project.getCompileDependencies();
+        for (Dependency dep : deps) {
+            if ("org.apache.camel.karaf".equals(dep.getGroupId()) && "camel-blueprint-main".equals(dep.getArtifactId())) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
     /**
      * Set up a classloader for the execution of the main class.
      *
@@ -777,7 +792,6 @@ public class RunMojo extends AbstractExecMojo {
         try {
             Set<Artifact> artifacts = new HashSet<>(this.pluginDependencies);
             for (Artifact artifact : artifacts) {
-                // must
                 if (artifact.getArtifactId().equals(extraPluginDependencyArtifactId)
                         || artifact.getArtifactId().equals(extendedPluginDependencyArtifactId)) {
                     getLog().debug("Adding extra plugin dependency artifact: " + artifact.getArtifactId()