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

JiriOndrusek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-upgrade-recipes.git


The following commit(s) were added to refs/heads/main by this push:
     new 41da3b5  Fixes #120: Add dependency rename and removal recipes for 
Camel 3.x to 4.0 migration
41da3b5 is described below

commit 41da3b556183842ac44a8e7d88e6dfa6975dc27f
Author: Jiri Ondrusek <[email protected]>
AuthorDate: Mon Aug 3 15:55:34 2026 +0200

    Fixes #120: Add dependency rename and removal recipes for Camel 3.x to 4.0 
migration
    
    Add recipes for removed components from the Camel 4 migration guide:
    - renamedDependencies: rename 11 components to their 4.0 replacements
    - removedDependencies: remove 14 components with no direct replacement
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../src/main/resources/META-INF/rewrite/4.0.yaml   | 113 +++++++++++++
 .../camel/upgrade/camel40/CamelDependencyTest.java | 179 +++++++++++++++++++++
 2 files changed, 292 insertions(+)

diff --git a/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.0.yaml 
b/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.0.yaml
index ffc0740..658ce23 100644
--- a/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.0.yaml
+++ b/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.0.yaml
@@ -49,6 +49,8 @@ recipeList:
   - org.apache.camel.upgrade.camel40.ChangeTypes
   - org.apache.camel.upgrade.camel40.ChangeManagedChoiceMBeanMethodName
   - 
org.apache.camel.upgrade.camel40.ChangeManagedFailoverLoadBalancerMBeanMethodName
+  - org.apache.camel.upgrade.camel40.renamedDependencies
+  - org.apache.camel.upgrade.camel40.removedDependencies
 ---
 type: specs.openrewrite.org/v1beta/recipe
 name: org.apache.camel.upgrade.camel40.ChangeTypes
@@ -108,3 +110,114 @@ recipeList:
       oldMethodName: getModelToXMLDumper
   - org.apache.camel.upgrade.customRecipes.MoveGetterToPluginHelper:
       oldMethodName: getRoutesLoader
+---
+#https://camel.apache.org/manual/camel-4-migration-guide.html#_removed_components
+type: specs.openrewrite.org/v1beta/recipe
+name: org.apache.camel.upgrade.camel40.renamedDependencies
+displayName: Rename removed Camel 3.x dependencies to their Camel 4.0 
replacements
+description: Rename removed Camel 3.x dependencies to their Camel 4.0 
replacements.
+recipeList:
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-swagger-java
+      newGroupId: org.apache.camel
+      newArtifactId: camel-openapi-java
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-rest-swagger
+      newGroupId: org.apache.camel
+      newArtifactId: camel-rest-openapi
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-directvm
+      newGroupId: org.apache.camel
+      newArtifactId: camel-direct
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-dozer
+      newGroupId: org.apache.camel
+      newArtifactId: camel-mapstruct
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-elasticsearch-rest
+      newGroupId: org.apache.camel
+      newArtifactId: camel-elasticsearch
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-rabbitmq
+      newGroupId: org.apache.camel
+      newArtifactId: camel-spring-rabbitmq
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-websocket
+      newGroupId: org.apache.camel
+      newArtifactId: camel-vertx-websocket
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-websocket-jsr356
+      newGroupId: org.apache.camel
+      newArtifactId: camel-vertx-websocket
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-vertx-kafka
+      newGroupId: org.apache.camel
+      newArtifactId: camel-kafka
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-vm
+      newGroupId: org.apache.camel
+      newArtifactId: camel-seda
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.camel
+      oldArtifactId: camel-xstream
+      newGroupId: org.apache.camel
+      newArtifactId: camel-jacksonxml
+---
+#https://camel.apache.org/manual/camel-4-migration-guide.html#_removed_components
+type: specs.openrewrite.org/v1beta/recipe
+name: org.apache.camel.upgrade.camel40.removedDependencies
+displayName: Remove Camel 3.x dependencies that have been removed in Camel 4.0 
with no direct replacement
+description: Remove Camel 3.x dependencies that have been removed in Camel 4.0 
with no single direct replacement.
+recipeList:
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-any23
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-atlasmap
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-atmos
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-corda
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-gora
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-hbase
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-hyperledger-aries
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-iota
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-ipfs
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-jbpm
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-jclouds
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-spark
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-spring-integration
+  - org.openrewrite.maven.RemoveDependency:
+      groupId: org.apache.camel
+      artifactId: camel-weka
diff --git 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/camel40/CamelDependencyTest.java
 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/camel40/CamelDependencyTest.java
new file mode 100644
index 0000000..96a0a43
--- /dev/null
+++ 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/camel40/CamelDependencyTest.java
@@ -0,0 +1,179 @@
+/*
+ * 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.
+ */
+package org.apache.camel.upgrade.camel40;
+
+import org.apache.camel.upgrade.CamelTestUtil;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+import org.junit.jupiter.params.provider.ValueSource;
+import org.openrewrite.test.RecipeSpec;
+import org.openrewrite.test.RewriteTest;
+
+import static org.openrewrite.maven.Assertions.pomXml;
+
+/**
+ * <a 
href="https://camel.apache.org/manual/camel-4-migration-guide.html#_removed_components";>Removed
 components</a>
+ */
+public class CamelDependencyTest implements RewriteTest {
+
+    @Override
+    public void defaults(RecipeSpec spec) {
+        CamelTestUtil.recipe(spec, CamelTestUtil.CamelVersion.v4_0)
+          
.parser(CamelTestUtil.parserFromClasspath(CamelTestUtil.CamelVersion.v3_18,
+            "camel-api"));
+    }
+
+    @DisabledIfSystemProperty(named = CamelTestUtil.PROPERTY_USE_RECIPE, 
matches = ".+")
+    @ParameterizedTest
+    @CsvSource({
+      "camel-swagger-java,       camel-openapi-java",
+      "camel-rest-swagger,       camel-rest-openapi",
+      "camel-directvm,           camel-direct",
+      "camel-dozer,              camel-mapstruct",
+      "camel-elasticsearch-rest, camel-elasticsearch",
+      "camel-rabbitmq,           camel-spring-rabbitmq",
+      "camel-websocket,          camel-vertx-websocket",
+      "camel-websocket-jsr356,   camel-vertx-websocket",
+      "camel-vertx-kafka,        camel-kafka",
+      "camel-vm,                 camel-seda",
+      "camel-xstream,            camel-jacksonxml"
+    })
+    void renamedDependencies(String oldArtifact, String newArtifact) {
+        //language=xml
+        rewriteRun(pomXml(
+          """
+            <project>
+               <modelVersion>4.0.0</modelVersion>
+
+               <artifactId>test</artifactId>
+               <groupId>org.apache.camel.test</groupId>
+               <version>1.0.0</version>
+
+               <dependencies>
+                   <dependency>
+                       <groupId>org.apache.camel</groupId>
+                       <artifactId>%s</artifactId>
+                       <version>3.20.0</version>
+                       <exclusions>
+                           <exclusion>
+                               <groupId>*</groupId>
+                               <artifactId>*</artifactId>
+                           </exclusion>
+                       </exclusions>
+                   </dependency>
+               </dependencies>
+
+            </project>
+            """.formatted(oldArtifact),
+          """
+            <project>
+               <modelVersion>4.0.0</modelVersion>
+
+               <artifactId>test</artifactId>
+               <groupId>org.apache.camel.test</groupId>
+               <version>1.0.0</version>
+
+               <dependencies>
+                   <dependency>
+                       <groupId>org.apache.camel</groupId>
+                       <artifactId>%s</artifactId>
+                       <version>3.20.0</version>
+                       <exclusions>
+                           <exclusion>
+                               <groupId>*</groupId>
+                               <artifactId>*</artifactId>
+                           </exclusion>
+                       </exclusions>
+                   </dependency>
+               </dependencies>
+
+            </project>
+            """.formatted(newArtifact)));
+    }
+
+    @DisabledIfSystemProperty(named = CamelTestUtil.PROPERTY_USE_RECIPE, 
matches = ".+")
+    @ParameterizedTest
+    @ValueSource(strings = {
+      "camel-any23",
+      "camel-atlasmap",
+      "camel-atmos",
+      "camel-corda",
+      "camel-gora",
+      "camel-hbase",
+      "camel-hyperledger-aries",
+      "camel-iota",
+      "camel-ipfs",
+      "camel-jbpm",
+      "camel-jclouds",
+      "camel-spark",
+      "camel-spring-integration",
+      "camel-weka"
+    })
+    void removedDependencies(String removedArtifact) {
+        //language=xml
+        rewriteRun(pomXml(
+          """
+            <project>
+               <modelVersion>4.0.0</modelVersion>
+
+               <artifactId>test</artifactId>
+               <groupId>org.apache.camel.test</groupId>
+               <version>1.0.0</version>
+
+               <dependencies>
+                   <dependency>
+                       <groupId>org.apache.camel</groupId>
+                       <artifactId>camel-core</artifactId>
+                       <version>3.20.0</version>
+                   </dependency>
+                   <dependency>
+                       <groupId>org.apache.camel</groupId>
+                       <artifactId>%s</artifactId>
+                       <version>3.20.0</version>
+                       <exclusions>
+                           <exclusion>
+                               <groupId>*</groupId>
+                               <artifactId>*</artifactId>
+                           </exclusion>
+                       </exclusions>
+                   </dependency>
+               </dependencies>
+
+            </project>
+            """.formatted(removedArtifact),
+          """
+            <project>
+               <modelVersion>4.0.0</modelVersion>
+
+               <artifactId>test</artifactId>
+               <groupId>org.apache.camel.test</groupId>
+               <version>1.0.0</version>
+
+               <dependencies>
+                   <dependency>
+                       <groupId>org.apache.camel</groupId>
+                       <artifactId>camel-core</artifactId>
+                       <version>3.20.0</version>
+                   </dependency>
+               </dependencies>
+
+            </project>
+            """));
+    }
+
+}

Reply via email to