You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/01/10 09:49:29 UTC

[camel] branch main created (now 8d4ca26)

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

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


      at 8d4ca26  Remove deprecated spring-javaconfig from camel-maven-plugin

This branch includes the following new commits:

     new 71b7cb0  CAMEL-15727: camel-cdi-main to have the Main class.
     new 8d4ca26  Remove deprecated spring-javaconfig from camel-maven-plugin

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.


[camel] 01/02: CAMEL-15727: camel-cdi-main to have the Main class.

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

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

commit 71b7cb09018be3b335410c0a11c1fcfca070f952
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jan 10 10:38:36 2022 +0100

    CAMEL-15727: camel-cdi-main to have the Main class.
---
 bom/camel-bom/pom.xml                              |  5 ++
 catalog/camel-allcomponents/pom.xml                |  4 ++
 .../org/apache/camel/catalog/others.properties     |  1 +
 .../org/apache/camel/catalog/others/cdi-main.json  | 15 +++++
 components/camel-cdi-main/pom.xml                  | 64 ++++++++++++++++++++++
 .../services/org/apache/camel/other.properties     |  7 +++
 .../src/generated/resources/cdi-main.json          | 15 +++++
 .../camel-cdi-main/src/main/docs/cdi-main.adoc     | 11 ++++
 .../src/main/java/org/apache/camel/cdi/Main.java   |  3 +-
 components/camel-cdi/pom.xml                       | 19 +++----
 components/pom.xml                                 |  1 +
 .../modules/others/examples/json/cdi-main.json     |  1 +
 docs/components/modules/others/nav.adoc            |  1 +
 docs/components/modules/others/pages/cdi-main.adoc |  1 +
 .../ROOT/pages/camel-3x-upgrade-guide-3_15.adoc    | 10 ++--
 parent/pom.xml                                     |  5 ++
 tooling/maven/camel-maven-plugin/pom.xml           |  4 +-
 .../main/java/org/apache/camel/maven/RunMojo.java  |  4 +-
 18 files changed, 150 insertions(+), 21 deletions(-)

diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 79f35dc..d403f58 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -418,6 +418,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-cdi-main</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-chatscript</artifactId>
         <version>${project.version}</version>
       </dependency>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 7688890..054e67a 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -287,6 +287,10 @@
 		</dependency>
 		<dependency>
 			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-cdi-main</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
 			<artifactId>camel-cdi</artifactId>
 		</dependency>
 		<dependency>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
index c2aa9fd..f3eeb14 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
@@ -2,6 +2,7 @@ attachments
 aws-xray
 caffeine-lrucache
 cdi
+cdi-main
 csimple-joor
 cxf-transport
 debug
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/cdi-main.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/cdi-main.json
new file mode 100644
index 0000000..a21b072
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/cdi-main.json
@@ -0,0 +1,15 @@
+{
+  "other": {
+    "kind": "other",
+    "name": "cdi-main",
+    "title": "CDI Main",
+    "description": "Using Camel Main with CDI",
+    "deprecated": false,
+    "firstVersion": "3.15.0",
+    "label": "java",
+    "supportLevel": "Preview",
+    "groupId": "org.apache.camel",
+    "artifactId": "camel-cdi-main",
+    "version": "3.15.0-SNAPSHOT"
+  }
+}
diff --git a/components/camel-cdi-main/pom.xml b/components/camel-cdi-main/pom.xml
new file mode 100644
index 0000000..ef49c25
--- /dev/null
+++ b/components/camel-cdi-main/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>3.15.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-cdi-main</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Camel :: CDI Main</name>
+    <description>Using Camel Main with CDI</description>
+
+    <properties>
+        <firstVersion>3.15.0</firstVersion>
+        <label>java</label>
+        <title>CDI Main</title>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-cdi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-main</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.deltaspike.cdictrl</groupId>
+            <artifactId>deltaspike-cdictrl-api</artifactId>
+            <version>${deltaspike-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.enterprise</groupId>
+            <artifactId>cdi-api</artifactId>
+            <version>${cdi-api-2.0-version}</version>
+        </dependency>
+
+    </dependencies>
+
+</project>
diff --git a/components/camel-cdi-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-cdi-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties
new file mode 100644
index 0000000..6720e62
--- /dev/null
+++ b/components/camel-cdi-main/src/generated/resources/META-INF/services/org/apache/camel/other.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+name=cdi-main
+groupId=org.apache.camel
+artifactId=camel-cdi-main
+version=3.15.0-SNAPSHOT
+projectName=Camel :: CDI Main
+projectDescription=Using Camel Main with CDI
diff --git a/components/camel-cdi-main/src/generated/resources/cdi-main.json b/components/camel-cdi-main/src/generated/resources/cdi-main.json
new file mode 100644
index 0000000..a21b072
--- /dev/null
+++ b/components/camel-cdi-main/src/generated/resources/cdi-main.json
@@ -0,0 +1,15 @@
+{
+  "other": {
+    "kind": "other",
+    "name": "cdi-main",
+    "title": "CDI Main",
+    "description": "Using Camel Main with CDI",
+    "deprecated": false,
+    "firstVersion": "3.15.0",
+    "label": "java",
+    "supportLevel": "Preview",
+    "groupId": "org.apache.camel",
+    "artifactId": "camel-cdi-main",
+    "version": "3.15.0-SNAPSHOT"
+  }
+}
diff --git a/components/camel-cdi-main/src/main/docs/cdi-main.adoc b/components/camel-cdi-main/src/main/docs/cdi-main.adoc
new file mode 100644
index 0000000..331530a
--- /dev/null
+++ b/components/camel-cdi-main/src/main/docs/cdi-main.adoc
@@ -0,0 +1,11 @@
+= CDI Main Component
+:doctitle: CDI Main
+:shortname: cdi-main
+:artifactid: camel-cdi-main
+:description: Using Camel Main with CDI
+:since: 3.15
+:supportlevel: Preview
+
+*Since Camel {since}*
+
+This module is used for running CDI standalone via a main class extended from `camel-main`.
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java b/components/camel-cdi-main/src/main/java/org/apache/camel/cdi/Main.java
similarity index 98%
rename from components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
rename to components/camel-cdi-main/src/main/java/org/apache/camel/cdi/Main.java
index b17ff62..aed8e28 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
+++ b/components/camel-cdi-main/src/main/java/org/apache/camel/cdi/Main.java
@@ -36,8 +36,7 @@ import static org.apache.camel.cdi.BeanManagerHelper.getReference;
 import static org.apache.deltaspike.cdise.api.CdiContainerLoader.getCdiContainer;
 
 /**
- * Camel CDI boot integration. Allows Camel and CDI to be booted up on the command line as a JVM process. See
- * http://camel.apache.org/camel-boot.html.
+ * Camel CDI boot integration. Allows Camel and CDI to be booted up on the command line as a JVM process.
  */
 @Vetoed
 public class Main extends MainCommandLineSupport {
diff --git a/components/camel-cdi/pom.xml b/components/camel-cdi/pom.xml
index 1832ca5..fea2dcb 100644
--- a/components/camel-cdi/pom.xml
+++ b/components/camel-cdi/pom.xml
@@ -65,11 +65,11 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-support</artifactId>
+            <artifactId>camel-core-engine</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-main</artifactId>
+            <artifactId>camel-support</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
@@ -80,15 +80,7 @@
             <artifactId>camel-mock</artifactId>
         </dependency>
 
-        <!-- DeltaSpike is only used to provide Main support thus optional -->
-        <dependency>
-            <groupId>org.apache.deltaspike.cdictrl</groupId>
-            <artifactId>deltaspike-cdictrl-api</artifactId>
-            <version>${deltaspike-version}</version>
-            <optional>true</optional>
-        </dependency>
-
-        <!-- provided dependencies -->
+        <!-- deprecated xml -->
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-core-xml</artifactId>
@@ -111,6 +103,11 @@
         <!-- test dependencies -->
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-languages</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-bean</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/components/pom.xml b/components/pom.xml
index 033934a..020885b 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -114,6 +114,7 @@
         <module>camel-cassandraql</module>
         <module>camel-cbor</module>
         <module>camel-cdi</module>
+        <module>camel-cdi-main</module>
         <module>camel-chatscript</module>
         <module>camel-chunk</module>
         <module>camel-cm-sms</module>
diff --git a/docs/components/modules/others/examples/json/cdi-main.json b/docs/components/modules/others/examples/json/cdi-main.json
new file mode 120000
index 0000000..ad8a2d3
--- /dev/null
+++ b/docs/components/modules/others/examples/json/cdi-main.json
@@ -0,0 +1 @@
+../../../../../../components/camel-cdi-main/src/generated/resources/cdi-main.json
\ No newline at end of file
diff --git a/docs/components/modules/others/nav.adoc b/docs/components/modules/others/nav.adoc
index c716fe3..19cd38d 100644
--- a/docs/components/modules/others/nav.adoc
+++ b/docs/components/modules/others/nav.adoc
@@ -6,6 +6,7 @@
 ** xref:aws-xray.adoc[AWS XRay]
 ** xref:caffeine-lrucache.adoc[Caffeine Lrucache]
 ** xref:cdi.adoc[CDI]
+** xref:cdi-main.adoc[CDI Main]
 ** xref:csimple-joor.adoc[CSimple jOOR]
 ** xref:cxf-transport.adoc[CXF Transport]
 ** xref:debug.adoc[Debug]
diff --git a/docs/components/modules/others/pages/cdi-main.adoc b/docs/components/modules/others/pages/cdi-main.adoc
new file mode 120000
index 0000000..1d9c122
--- /dev/null
+++ b/docs/components/modules/others/pages/cdi-main.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-cdi-main/src/main/docs/cdi-main.adoc
\ No newline at end of file
diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc
index 65d8cc3..d4e33be 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc
@@ -69,10 +69,6 @@ node in the JMX MBean tree.
 
 Removed deprecated operations on `CamelContextMBean` and `CamelRouteMBean`.
 
-=== camel-salesforce
-
-The `getResources` operation now returns a `Map<String, String>` instead of `RestResources`.
-
 === camel-util
 
 Deleted the `replaceAll` method of `org.apache.camel.util.StringHelper`. Please use the `replace` method of `java.lang.String` instead, as it is much faster from Java 11 onward.
@@ -110,6 +106,12 @@ This should correctly be done with `steps` as child of `from`:
 
 The JBang app that was previously named `CamelJBang` is now named `camel`. It is still possible to use the older name by installing it using `CamelJBang@apache/camel` but this approach is deprecated and should not be used in the future.
 
+=== camel-cdi
+
+The legacy XML in `camel-cdi` with `<camelContext>` is deprecated, instead the XML DSL route loader should be used.
+
+The `org.apache.camel.cdi.Main` class has moved from `camel-cdi` to `camel-cdi-main` JAR.
+
 === camel-karaf
 
 The `camel-endpointdsl` and `camel-componentdsl` is no longer supported on Apache Karaf.
diff --git a/parent/pom.xml b/parent/pom.xml
index 91b41e4..bb1d9d2 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1117,6 +1117,11 @@
 			</dependency>
 			<dependency>
 				<groupId>org.apache.camel</groupId>
+				<artifactId>camel-cdi-main</artifactId>
+				<version>${project.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.camel</groupId>
 				<artifactId>camel-cdi</artifactId>
 				<version>${project.version}</version>
 			</dependency>
diff --git a/tooling/maven/camel-maven-plugin/pom.xml b/tooling/maven/camel-maven-plugin/pom.xml
index 3079d23..8238da5 100644
--- a/tooling/maven/camel-maven-plugin/pom.xml
+++ b/tooling/maven/camel-maven-plugin/pom.xml
@@ -86,10 +86,10 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-spring-javaconfig</artifactId>
         </dependency>
-        <!-- camel-cdi has Main class for running CDI -->
+        <!-- camel-cdi-main has Main class for running CDI -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-cdi</artifactId>
+            <artifactId>camel-cdi-main</artifactId>
         </dependency>
         <!-- for logging in color -->
         <dependency>
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 c290477..2c85623 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
@@ -649,8 +649,8 @@ public class RunMojo extends AbstractExecMojo {
     private boolean detectCDIOnClassPath() {
         List<Dependency> deps = project.getCompileDependencies();
         for (Dependency dep : deps) {
-            if ("org.apache.camel".equals(dep.getGroupId()) && "camel-cdi".equals(dep.getArtifactId())) {
-                getLog().info("camel-cdi detected on classpath");
+            if ("org.apache.camel".equals(dep.getGroupId()) && "camel-cdi-main".equals(dep.getArtifactId())) {
+                getLog().info("camel-cdi-main detected on classpath");
                 return true;
             }
         }

[camel] 02/02: Remove deprecated spring-javaconfig from camel-maven-plugin

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

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

commit 8d4ca26e1bbd89023eb6a3cc2545eb8b3d8daed9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jan 10 10:41:20 2022 +0100

    Remove deprecated spring-javaconfig from camel-maven-plugin
---
 .../main/java/org/apache/camel/maven/RunMojo.java  | 30 +---------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

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 2c85623..6f290a8 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
@@ -170,18 +170,6 @@ public class RunMojo extends AbstractExecMojo {
     private String mainClass;
 
     /**
-     * The basedPackages that spring java config want to gets.
-     */
-    @Parameter(property = "camel.basedPackages")
-    private String basedPackages;
-
-    /**
-     * The configClasses that spring java config want to gets.
-     */
-    @Parameter(property = "camel.configClasses")
-    private String configClasses;
-
-    /**
      * The classpath based application context uri that spring want to gets.
      */
     @Parameter(property = "camel.applicationContextUri")
@@ -312,8 +300,6 @@ public class RunMojo extends AbstractExecMojo {
             getLog().info("You can skip tests from the command line using: mvn " + goal() + " -Dmaven.test.skip=true");
         }
 
-        boolean usingSpringJavaConfigureMain = false;
-
         boolean useCdiMain;
         if (useCDI != null) {
             // use configured value
@@ -345,17 +331,6 @@ public class RunMojo extends AbstractExecMojo {
             args.add(fileApplicationContextUri);
         }
 
-        if (configClasses != null) {
-            args.add("-cc");
-            args.add(configClasses);
-            usingSpringJavaConfigureMain = true;
-        }
-        if (basedPackages != null) {
-            args.add("-bp");
-            args.add(basedPackages);
-            usingSpringJavaConfigureMain = true;
-        }
-
         if (!duration.equals("-1")) {
             args.add("-d");
             args.add(duration);
@@ -372,10 +347,7 @@ public class RunMojo extends AbstractExecMojo {
             args.addAll(Arrays.asList(arguments));
         }
 
-        if (usingSpringJavaConfigureMain) {
-            mainClass = "org.apache.camel.spring.javaconfig.Main";
-            getLog().info("Using org.apache.camel.spring.javaconfig.Main to initiate a CamelContext");
-        } else if (useCdiMain) {
+        if (useCdiMain) {
             mainClass = "org.apache.camel.cdi.Main";
             // must include plugin dependencies for cdi
             extraPluginDependencyArtifactId = "camel-cdi";