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

dashorst pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/master by this push:
     new 42581105d7 Let MigrateToWicket10 move wicket-metrics to the 
experimental.wicket10 groupId
42581105d7 is described below

commit 42581105d7aa75cfcb65bbe798691513971c216b
Author: Martijn Dashorst <[email protected]>
AuthorDate: Sun Nov 1 15:28:30 2026 +0100

    Let MigrateToWicket10 move wicket-metrics to the experimental.wicket10 
groupId
    
    MigrateToWicket10 handled the experimental modules with two identical
    UpgradeDependencyVersion steps that upgraded
    org.apache.wicket.experimental.wicket9:* to 10.x. The experimental.wicket9
    artifacts were only ever published with 0.x versions, so the 10.x range
    matched nothing and the steps changed nothing. In Wicket 10, wicket-metrics
    is published under org.apache.wicket.experimental.wicket10. A Wicket 9
    project that used wicket-metrics kept experimental.wicket9:wicket-metrics
    at its 0.x version after the migration, next to Wicket 10 core artifacts.
    The experimental http2 modules are removed earlier in the recipe, so
    wicket-metrics was the only artifact these steps could have applied to.
    
    Both steps are replaced by a ChangeDependencyGroupIdAndArtifactId that
    moves experimental.wicket9:wicket-metrics to experimental.wicket10 at the
    latest 10.x release, the same way MigrateToWicket11 moves it from
    experimental.wicket10 to experimental.wicket11. A project migrated with
    the recipe now ends up on experimental.wicket10:wicket-metrics.
    
    MigrateToWicket10Test#migrateExperimentalMetrics covers the move.
    
    GitHub issue #1755
    See also GitHub issue #1752 and pull request #1753 for wicket-10.x
    
    (cherry picked from commit 91e28d883e48cd3488aacf7abd75c7e69c0b5254)
    
    Generated-by: Claude Code (Claude Opus 5.5)
---
 .../src/main/resources/META-INF/rewrite/wicket.yml | 11 ++---
 .../wicket/migration/MigrateToWicket10Test.java    | 47 ++++++++++++++++++++++
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml 
b/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
index 1571984622..87c887655b 100644
--- a/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
+++ b/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
@@ -35,13 +35,10 @@ recipeList:
       groupId: org.apache.wicket
       artifactId: "*"
       newVersion: 10.x
-  - org.openrewrite.maven.UpgradeDependencyVersion:
-      groupId: org.apache.wicket.experimental.wicket9
-      artifactId: "*"
-      newVersion: 10.x
-  - org.openrewrite.maven.UpgradeDependencyVersion:
-      groupId: org.apache.wicket.experimental.wicket9
-      artifactId: "*"
+  - org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
+      oldGroupId: org.apache.wicket.experimental.wicket9
+      oldArtifactId: wicket-metrics
+      newGroupId: org.apache.wicket.experimental.wicket10
       newVersion: 10.x
 ---
 # https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+11.0
diff --git 
a/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
 
b/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
index 91fb6007a3..cd6c71c628 100644
--- 
a/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
+++ 
b/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
@@ -128,4 +128,51 @@ class MigrateToWicket10Test implements RewriteTest {
         );
     }
 
+    @Test
+    void migrateExperimentalMetrics() {
+        //language=xml
+        rewriteRun(
+                mavenProject("any-project",
+                        pomXml("""
+                                        <project>
+                                            <modelVersion>4.0.0</modelVersion>
+                                            <groupId>com.example</groupId>
+                                            <artifactId>wicket</artifactId>
+                                            <version>1.0.0</version>
+                                            <dependencies>
+                                                <dependency>
+                                                    
<groupId>org.apache.wicket.experimental.wicket9</groupId>
+                                                    
<artifactId>wicket-metrics</artifactId>
+                                                    <version>0.35</version>
+                                                </dependency>
+                                            </dependencies>
+                                        </project>
+                                        """,
+                                spec -> spec.after(pom -> {
+                                    Matcher version = 
Pattern.compile("<version>(10\\.[^<]+)</version>").matcher(pom);
+                                    
assertThat(version.find()).describedAs("Expected 10.x in %s", pom).isTrue();
+                                    return String.format("""
+                                            <project>
+                                                
<modelVersion>4.0.0</modelVersion>
+                                                <groupId>com.example</groupId>
+                                                <artifactId>wicket</artifactId>
+                                                <version>1.0.0</version>
+                                                <properties>
+                                                    
<maven.compiler.release>17</maven.compiler.release>
+                                                </properties>
+                                                <dependencies>
+                                                    <dependency>
+                                                        
<groupId>org.apache.wicket.experimental.wicket10</groupId>
+                                                        
<artifactId>wicket-metrics</artifactId>
+                                                        <version>%s</version>
+                                                    </dependency>
+                                                </dependencies>
+                                            </project>
+                                            """, version.group(1));
+                                })
+                        )
+                )
+        );
+    }
+
 }

Reply via email to