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

Croway 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 4d6f6be  Upgrade the org.apache.camel.springboot parent in Spring Boot 
migrations
4d6f6be is described below

commit 4d6f6be3860ac70ba9b489fe3a20129c7baefaa5
Author: Merlin Bögershausen <[email protected]>
AuthorDate: Fri Sep 11 14:14:03 2026 +0200

    Upgrade the org.apache.camel.springboot parent in Spring Boot migrations
    
    The Spring Boot bump blocks scope UpgradeParentVersion to org.apache.camel,
    which does not glob-match org.apache.camel.springboot. A project inheriting
    org.apache.camel.springboot:spring-boot kept its old parent and carried on
    resolving the Camel release it started from. This adds the parent entry
    alongside the UpgradeDependencyVersion that already covers that groupId.
    
    Also adds the missing trailing period to CamelSpringBootMigrationRecipe's
    description, which RewriteTest validation requires.
    
    The test covers the 4.18 LTS chain; the same entry in 4.19.yaml resolves to
    project.version, which only exists in a release build.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
 .../main/resources/META-INF/rewrite/4.18LTS.yaml   |  4 ++
 .../src/main/resources/META-INF/rewrite/4.19.yaml  |  4 ++
 .../main/resources/META-INF/rewrite/latest.yaml    |  4 +-
 .../CamelSpringBootParentVersionTest.java          | 76 ++++++++++++++++++++++
 4 files changed, 86 insertions(+), 2 deletions(-)

diff --git 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.18LTS.yaml
 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.18LTS.yaml
index 1c4684b..4343bfc 100644
--- 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.18LTS.yaml
+++ 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.18LTS.yaml
@@ -51,6 +51,10 @@ recipeList:
       groupId: 'org.apache.camel'
       artifactId: '*'
       newVersion: @camel4.18-lts-version@
+  - org.openrewrite.maven.UpgradeParentVersion:
+      groupId: 'org.apache.camel.springboot'
+      artifactId: '*'
+      newVersion: @camel4.18-lts-version@
   - org.openrewrite.maven.ChangePropertyValue:
       key: camel.version
       newValue: @camel4.18-lts-version@
diff --git 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.19.yaml
 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.19.yaml
index f33f188..388a20a 100644
--- 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.19.yaml
+++ 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/4.19.yaml
@@ -44,6 +44,10 @@ recipeList:
       groupId: 'org.apache.camel.springboot'
       artifactId: '*'
       newVersion: @camel-spring-boot-version@
+  - org.openrewrite.maven.UpgradeParentVersion:
+      groupId: 'org.apache.camel.springboot'
+      artifactId: '*'
+      newVersion: @camel-spring-boot-version@
   - org.openrewrite.maven.ChangePropertyValue:
       key: camel-spring-boot.version
       newValue: @camel-spring-boot-version@
diff --git 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
index 8d35ace..42a50f9 100644
--- 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
+++ 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
@@ -18,8 +18,8 @@
 type: specs.openrewrite.org/v1beta/recipe
 name: org.apache.camel.upgrade.CamelSpringBootMigrationRecipe
 displayName: Migrate to Apache Camel Spring Boot @camel-latest-version@
-description: >- 
-  Migrate applications to Apache Camel Spring Boot @camel-latest-version@ and 
Spring Boot @spring-boot-version@
+description: >-
+  Migrate applications to Apache Camel Spring Boot @camel-latest-version@ and 
Spring Boot @spring-boot-version@.
 recipeList:
   - org.apache.camel.upgrade.camel422.CamelSpringBootMigrationRecipe
   - org.openrewrite.maven.UpgradeDependencyVersion:
diff --git 
a/camel-spring-boot-upgrade-recipes/src/test/java/org/apache/camel/upgrade/springboot/CamelSpringBootParentVersionTest.java
 
b/camel-spring-boot-upgrade-recipes/src/test/java/org/apache/camel/upgrade/springboot/CamelSpringBootParentVersionTest.java
new file mode 100644
index 0000000..a805744
--- /dev/null
+++ 
b/camel-spring-boot-upgrade-recipes/src/test/java/org/apache/camel/upgrade/springboot/CamelSpringBootParentVersionTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.springboot;
+
+import org.junit.jupiter.api.Test;
+import org.openrewrite.DocumentExample;
+import org.openrewrite.test.RecipeSpec;
+import org.openrewrite.test.RewriteTest;
+
+import static org.openrewrite.maven.Assertions.pomXml;
+
+/**
+ * Camel Spring Boot applications commonly inherit from the
+ * {@code org.apache.camel.springboot:spring-boot} parent, as Apache's own 
camel-spring-boot-examples
+ * do. {@code UpgradeParentVersion} was only scoped to {@code 
org.apache.camel}, which OpenRewrite
+ * matches as a glob without a wildcard, so such a parent was left on its 
original version and the
+ * project kept resolving the Camel release it started from.
+ * <p>
+ * The LTS recipe is used because its target is a fixed released version, 
unlike the latest recipe
+ * whose target follows {@code project.version}.
+ */
+class CamelSpringBootParentVersionTest implements RewriteTest {
+
+    @Override
+    public void defaults(RecipeSpec spec) {
+        
spec.recipeFromResources("org.apache.camel.upgrade.CamelSpringBoot418LTSMigrationRecipe");
+    }
+
+    @DocumentExample
+    @Test
+    void camelSpringBootParent() {
+        //language=xml
+        rewriteRun(
+                pomXml(
+                        """
+                                <project>
+                                    <modelVersion>4.0.0</modelVersion>
+                                    <parent>
+                                        
<groupId>org.apache.camel.springboot</groupId>
+                                        <artifactId>spring-boot</artifactId>
+                                        <version>4.10.0</version>
+                                    </parent>
+                                    <groupId>com.example</groupId>
+                                    <artifactId>test</artifactId>
+                                    <version>1.0.0</version>
+                                </project>
+                                """,
+                        """
+                                <project>
+                                    <modelVersion>4.0.0</modelVersion>
+                                    <parent>
+                                        
<groupId>org.apache.camel.springboot</groupId>
+                                        <artifactId>spring-boot</artifactId>
+                                        <version>4.18.3</version>
+                                    </parent>
+                                    <groupId>com.example</groupId>
+                                    <artifactId>test</artifactId>
+                                    <version>1.0.0</version>
+                                </project>
+                                """));
+    }
+}

Reply via email to