camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-10293: camel:run should use explicit configured useBlueprint/useCdi configuration if provided.
Date Sat, 10 Sep 2016 11:04:59 GMT
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/33e43e74
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/33e43e74
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/33e43e74

Branch: refs/heads/camel-2.17.x
Commit: 33e43e742daa1d57a53c3f0e1fd3124582391bb0
Parents: dd84c7d
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:04: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/33e43e74/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 a57d94d..d5bd2d5 100644
--- a/examples/camel-example-sql-blueprint/pom.xml
+++ b/examples/camel-example-sql-blueprint/pom.xml
@@ -77,10 +77,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/33e43e74/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