dashorst opened a new pull request, #1741:
URL: https://github.com/apache/wicket/pull/1741

   Fixes #1738.
   
   `MigrateToWicket10` upgraded everything except the Wicket version. Its 
`UpgradeDependencyVersion` step for `org.apache.wicket:*` carried 
`versionPattern: -SNAPSHOT`, which limits the candidates to snapshots; release 
repositories have none, so the step did nothing. A Wicket 9 project came out 
with Java 17, Jakarta, the `PushHeaderItem` change and the http2 dependencies 
removed, but with its Wicket 9 core artifacts, while the `wicket-tester` 
dependency the recipe adds came in at the latest 10.x.
   
   This PR removes the `versionPattern`, re-enables 
`MigrateToWicket10Test#migrateDependencies` (disabled since before the first 
10.x release) and corrects its expectation: the version regex captured the 
closing tag, and the expected pom lacked the `maven.compiler.release` property 
that `UpgradeToJava17` adds.
   
   One change is specific to 10.x: the root pom manages 
`com.fasterxml.jackson.core:jackson-databind` at 2.14.3, which also reached 
`wicket-migration`, while `rewrite-maven` brings `jackson-dataformat-xml` 
2.17.2. With the test enabled, reading the Maven settings failed with 
`NoSuchMethodError: PropertyName.merge(...)` before the recipe ran. 
`wicket-migration` now manages `jackson-databind` at 2.17.2, matching 
OpenRewrite's other Jackson artifacts. Master manages Jackson 3 
(`tools.jackson`) in the root pom and does not have this problem.
   
   The master fix is #1740 (issue #1739).
   
   ### Test before the recipe fix
   
   `mvn -B verify -pl wicket-migration -Dtest=MigrateToWicket10Test`, with the 
test enabled, the expectation corrected and the Jackson pin applied, but 
`versionPattern` still in place:
   
   ```
   [ERROR] Failures: 
   [ERROR]   
MigrateToWicket10Test.migrateDependencies:83->lambda$migrateDependencies$0:107 
[Expected 10.x in <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</groupId>
               <artifactId>wicket-core</artifactId>
               <version>9.12.0</version>
           </dependency>
       </dependencies>
   </project>] 
   Expecting value to be true but was false
   [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
   ```
   
   Without the Jackson pin the test errors instead:
   
   ```
   [ERROR]   MigrateToWicket10Test.migrateDependencies:83 » NoSuchMethod 
'com.fasterxml.jackson.databind.PropertyName 
com.fasterxml.jackson.databind.PropertyName.merge(com.fasterxml.jackson.databind.PropertyName,
 com.fasterxml.jackson.databind.PropertyName)'
   ```
   
   ### Test after the fix
   
   ```
   [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.751 
s -- in org.apache.wicket.migration.MigrateToWicket10Test
   [INFO] BUILD SUCCESS
   ```
   
   A full `mvn clean verify -Pjs-test` is green locally; japicmp reports 
nothing.
   
   ### Quickstart
   
   `MigrateToWicket10` from the released `wicket-migration:10.12.0`, run 
through `rewrite-maven-plugin` 6.46.1 on a 9.25.0 quickstart, leaves 
`wicket.version` at 9.25.0 while the added `wicket-tester` gets 10.12.0. A 
local copy of the recipe without `versionPattern` sets `wicket.version` to 
10.12.0. The released recipe ran fine through the plugin despite the 2.14.3 
management, so the Jackson pin concerns this module's test classpath.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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