dashorst opened a new issue, #1752:
URL: https://github.com/apache/wicket/issues/1752

   The `org.apache.wicket.MigrateToWicket10` recipe in `wicket-migration` does 
not migrate `wicket-metrics`. A Wicket 9 project that depends on 
`org.apache.wicket.experimental.wicket9:wicket-metrics` keeps that dependency 
at its Wicket 9 groupId and 0.x version, while the rest of the project moves to 
Wicket 10, Java 17 and Jakarta.
   
   ## Cause
   
   `wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml` handles 
the experimental modules with two identical steps:
   
   ```yaml
     - org.openrewrite.maven.UpgradeDependencyVersion:
         groupId: org.apache.wicket.experimental.wicket9
         artifactId: "*"
         newVersion: 10.x
   ```
   
   The `experimental.wicket9` artifacts were only published with 0.x versions 
(`wicket-metrics` 0.7 to 0.37), so a `10.x` range finds nothing and the step 
changes nothing. In Wicket 10, `wicket-metrics` is published under the groupId 
`org.apache.wicket.experimental.wicket10` (10.1.0 onwards). The experimental 
http2 modules are already removed earlier in the recipe, which leaves 
`wicket-metrics` as the only `experimental.wicket9` artifact a project would 
still depend on.
   
   The fix is to replace both steps with a 
`ChangeDependencyGroupIdAndArtifactId` from 
`experimental.wicket9:wicket-metrics` to `experimental.wicket10` at `10.x`, the 
way `MigrateToWicket11` moves `wicket-metrics` from `experimental.wicket10` to 
`experimental.wicket11`.
   
   ## Reproduction
   
   1. Take a Wicket 9.25.0 quickstart (`wicket-archetype-quickstart`) and add
   
      ```xml
      <dependency>
          <groupId>org.apache.wicket.experimental.wicket9</groupId>
          <artifactId>wicket-metrics</artifactId>
          <version>0.37</version>
      </dependency>
      ```
   
   2. Run
   
      ```
      mvn org.openrewrite.maven:rewrite-maven-plugin:6.46.1:run \
          
-Drewrite.recipeArtifactCoordinates=org.apache.wicket:wicket-migration:10.12.0 \
          -Drewrite.activeRecipes=org.apache.wicket.MigrateToWicket10
      ```
   
   3. The dependency is still 
`org.apache.wicket.experimental.wicket9:wicket-metrics:0.37`.
   
   ## Affected
   
   `wicket-migration` 10.0.0 up to and including 10.12.0. Master's copy of 
`MigrateToWicket10` contains the same two steps.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to