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
The following commit(s) were added to refs/heads/master by this push: new c548543 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. c548543 is described below commit c548543d4988845a152e27e774a351767503b833 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Jun 19 14:46:00 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. --- .../java/org/apache/camel/maven/SpringBootToolingMojo.java | 13 ++++++++++++- .../resources/META-INF/spring-configuration-metadata.json | 6 +++--- .../java/org/apache/camel/maven/PrepareCamelMainMojo.java | 13 ++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/SpringBootToolingMojo.java b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/SpringBootToolingMojo.java index b2ef459..f686df6 100644 --- a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/SpringBootToolingMojo.java +++ b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/SpringBootToolingMojo.java @@ -143,7 +143,18 @@ public class SpringBootToolingMojo extends AbstractMainMojo { sb.append(ch); } } - return sb.toString(); + + // somme words we dont want ID -> i-d, but keep it as id + String answer = sb.toString(); + answer = answer.replaceAll("-i-d-", "-id-"); + answer = answer.replaceAll("-u-r-i-", "-uri-"); + answer = answer.replaceAll("-u-r-l-", "-url-"); + answer = answer.replaceAll("-j-m-s-", "-jms-"); + answer = answer.replaceAll("-j-m-x-", "-jmx-"); + answer = answer.replaceFirst("-i-d$", "-id"); + answer = answer.replaceFirst("-u-r-i$", "-uri"); + answer = answer.replaceFirst("-u-r-l$", "-url"); + return answer; } private static String springBootJavaType(String javaType) { diff --git a/examples/camel-example-main-artemis/src/main/resources/META-INF/spring-configuration-metadata.json b/examples/camel-example-main-artemis/src/main/resources/META-INF/spring-configuration-metadata.json index df6942f..4f3190e 100644 --- a/examples/camel-example-main-artemis/src/main/resources/META-INF/spring-configuration-metadata.json +++ b/examples/camel-example-main-artemis/src/main/resources/META-INF/spring-configuration-metadata.json @@ -785,7 +785,7 @@ "defaultValue": false }, { - "name": "camel.component.jms.use-message-i-d-as-correlation-i-d", + "name": "camel.component.jms.use-message-id-as-correlation-id", "type": "java.lang.Boolean", "description": "Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.", "defaultValue": false @@ -941,13 +941,13 @@ "defaultValue": true }, { - "name": "camel.component.jms.include-sent-j-m-s-message-i-d", + "name": "camel.component.jms.include-sent-jms-message-id", "type": "java.lang.Boolean", "description": "Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.", "defaultValue": false }, { - "name": "camel.component.jms.include-all-j-m-s-x-properties", + "name": "camel.component.jms.include-all-jms-x-properties", "type": "java.lang.Boolean", "description": "Whether to include all JMSXxxx properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.", "defaultValue": false diff --git a/tooling/maven/camel-main-package-maven-plugin/src/main/java/org/apache/camel/maven/PrepareCamelMainMojo.java b/tooling/maven/camel-main-package-maven-plugin/src/main/java/org/apache/camel/maven/PrepareCamelMainMojo.java index e205fa3..2cb1537 100644 --- a/tooling/maven/camel-main-package-maven-plugin/src/main/java/org/apache/camel/maven/PrepareCamelMainMojo.java +++ b/tooling/maven/camel-main-package-maven-plugin/src/main/java/org/apache/camel/maven/PrepareCamelMainMojo.java @@ -136,7 +136,18 @@ public class PrepareCamelMainMojo extends AbstractMojo { sb.append(ch); } } - return sb.toString(); + + // somme words we dont want ID -> i-d, but keep it as id + String answer = sb.toString(); + answer = answer.replaceAll("-i-d-", "-id-"); + answer = answer.replaceAll("-u-r-i-", "-uri-"); + answer = answer.replaceAll("-u-r-l-", "-url-"); + answer = answer.replaceAll("-j-m-s-", "-jms-"); + answer = answer.replaceAll("-j-m-x-", "-jmx-"); + answer = answer.replaceFirst("-i-d$", "-id"); + answer = answer.replaceFirst("-u-r-i$", "-uri"); + answer = answer.replaceFirst("-u-r-l$", "-url"); + return answer; } private static String springBootJavaType(String javaType) {