camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-10293: camel:run should use explicit configured useBlueprint/useCdi configuration if provided.
Date Sat, 10 Sep 2016 11:04:58 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x dd84c7d9e -> 33e43e742
  refs/heads/master 230ab2f1b -> 1982d0a28


CAMEL-10293: camel:run should use explicit configured useBlueprint/useCdi configuration if
provided.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1982d0a2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1982d0a2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1982d0a2

Branch: refs/heads/master
Commit: 1982d0a2851d76ffe904912299712cf7752eff41
Parents: 230ab2f
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Sep 10 13:03:32 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Sep 10 13:03:32 2016 +0200

----------------------------------------------------------------------
 examples/camel-example-sql-blueprint/pom.xml    |  4 ---
 .../java/org/apache/camel/maven/RunMojo.java    | 26 +++++++++++++++-----
 2 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1982d0a2/examples/camel-example-sql-blueprint/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-sql-blueprint/pom.xml b/examples/camel-example-sql-blueprint/pom.xml
index 3d7c00b..7ecc521 100644
--- a/examples/camel-example-sql-blueprint/pom.xml
+++ b/examples/camel-example-sql-blueprint/pom.xml
@@ -85,10 +85,6 @@
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-maven-plugin</artifactId>
         <version>${project.version}</version>
-        <configuration>
-          <!-- Tell camel run plugin to load application from the blueprint file -->
-          <useBlueprint>true</useBlueprint>
-        </configuration>
       </plugin>
     </plugins>
   </build>

http://git-wip-us.apache.org/repos/asf/camel/blob/1982d0a2/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
----------------------------------------------------------------------
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 0b0100c..5e37b15 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
@@ -106,17 +106,15 @@ public class RunMojo extends AbstractExecMojo {
      * Whether to use Blueprint when running, instead of Spring
      *
      * @parameter property="camel.useBlueprint"
-     *            default-value="false"
      */
-    protected boolean useBlueprint;
+    protected Boolean useBlueprint;
 
     /**
      * Whether to use CDI when running, instead of Spring
      *
      * @parameter property="camel.useCDI"
-     *            default-value="false"
      */
-    protected boolean useCDI;
+    protected Boolean useCDI;
     
     protected String extendedPluginDependencyArtifactId;
 
@@ -361,8 +359,24 @@ public class RunMojo extends AbstractExecMojo {
      */
     public void execute() throws MojoExecutionException, MojoFailureException {
         boolean usingSpringJavaConfigureMain = false;
-        boolean useCdiMain = useCDI || detectCDIOnClassPath();
-        boolean usingBlueprintMain = useBlueprint || detectBlueprintOnClassPathOrBlueprintXMLFiles();
+
+        boolean useCdiMain = false;
+        if (useCDI != null) {
+            // use configured value
+            useCdiMain = useCDI;
+        } else {
+            // auto detect if we have cdi
+            useCdiMain = detectCDIOnClassPath();
+        }
+        boolean usingBlueprintMain = false;
+        if (useBlueprint != null) {
+            // use configured value
+            usingBlueprintMain = useBlueprint;
+        } else {
+            // auto detect if we have blueprint
+            usingBlueprintMain = detectBlueprintOnClassPathOrBlueprintXMLFiles();
+        }
+
         if (killAfter != -1) {
             getLog().warn("Warning: killAfter is now deprecated. Do you need it ? Please
comment on MEXEC-6.");
         }


Mime
View raw message