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 2019/06/21 08:52:23 UTC

[camel] 08/08: CAMEL-13663: camel-main-maven-plugin to generte spring-boot tooling metadata to fool Java editors to have code completions for Camel Main application.properties files.

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 8d9f781a7f1f788454c29f8339fd6cbbc8f01e9f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jun 21 10:42:46 2019 +0200

    CAMEL-13663: camel-main-maven-plugin to generte spring-boot tooling metadata to fool Java editors to have code completions for Camel Main application.properties files.
---
 .../src/main/java/org/apache/camel/maven/GenerateMojo.java     |  9 ++++++++-
 examples/camel-example-main-artemis/pom.xml                    | 10 ++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
index 04d5567..bf80dba 100644
--- a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
+++ b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
@@ -317,7 +317,14 @@ public class GenerateMojo extends AbstractMainMojo {
                 if ("#skip#".equals(k)) {
                     return null;
                 }
-                Class found = candidates.stream().filter(c -> c.getName().equals(k)).findFirst().orElse(null);
+                // jump to after the leading prefix to have the classname
+                if (k.startsWith("#class:")) {
+                    k = k.substring(7);
+                } else if (k.startsWith("#type:")) {
+                    k = k.substring(6);
+                }
+                final String candiateName = k;
+                Class found = candidates.stream().filter(c -> c.getName().equals(candiateName)).findFirst().orElse(null);
                 if (found != null) {
                     return found;
                 }
diff --git a/examples/camel-example-main-artemis/pom.xml b/examples/camel-example-main-artemis/pom.xml
index f77c46b..f1ea8df 100644
--- a/examples/camel-example-main-artemis/pom.xml
+++ b/examples/camel-example-main-artemis/pom.xml
@@ -39,6 +39,14 @@
 
     <dependencies>
 
+        <!-- to have spring boot tooling support in IDEA you need spring-boot JARs on the classpath -->
+<!--
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+-->
+
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-core</artifactId>
@@ -110,6 +118,8 @@
                     <!-- <logUnmapped>true</logUnmapped> -->
                     <!-- just include only the jms component -->
                     <!-- <include>jms</include> -->
+                    <!-- to use spring caching connection factory instead of the default -->
+                    <!-- <mappings>javax.jms.ConnectionFactory=#class:org.springframework.jms.connection.CachingConnectionFactory</mappings> -->
                 </configuration>
                 <executions>
                     <execution>