Repository navigation
Conversation
MigrateToWicket10 ends with an UpgradeDependencyVersion step for org.apache.wicket:* that carries versionPattern: -SNAPSHOT. That pattern restricts the candidate versions to snapshots, and release repositories have none, so the step found nothing and left the version alone. A Wicket 9 project migrated with the recipe kept its Wicket 9 wicket-core and the other org.apache.wicket artifacts, while the remaining steps did run: the move to Java 17, the javax to jakarta migration, the PushHeaderItem type change and the removal of the experimental http2 dependencies. Where the project used WicketTester, the wicket-tester dependency the recipe adds came in at the latest 10.x release. The result was a project mixing Wicket 9 core artifacts with Wicket 10, Java 17 and Jakarta changes, and the recipe gave no sign of it. The versionPattern is removed, so the step selects the latest 10.x release. Running the recipe now also upgrades the org.apache.wicket dependencies, or the property that holds their version. MigrateToWicket10Test#migrateDependencies had been disabled until the first 10.x release and never re-enabled, which is how this went unnoticed. It is enabled again, with its expectation corrected: the version regex captured the closing tag, and the expected pom lacked the maven.compiler.release property that UpgradeToJava17 adds. Enabled, the test could not run on this branch: the root pom manages com.fasterxml.jackson.core:jackson-databind at 2.14.3, which also applied to wicket-migration, while rewrite-maven brings jackson-dataformat-xml 2.17.2. Reading the Maven settings then failed with a NoSuchMethodError on PropertyName.merge. wicket-migration now manages jackson-databind at 2.17.2, the version the rest of OpenRewrite's Jackson dependencies use. This is the wicket-10.x counterpart of commit cd372c3 on master. GitHub issue apache#1738 See also GitHub issue apache#1739 and pull request apache#1740 for master Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1738.
MigrateToWicket10upgraded everything except the Wicket version. ItsUpgradeDependencyVersionstep fororg.apache.wicket:*carriedversionPattern: -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, thePushHeaderItemchange and the http2 dependencies removed, but with its Wicket 9 core artifacts, while thewicket-testerdependency the recipe adds came in at the latest 10.x.This PR removes the
versionPattern, re-enablesMigrateToWicket10Test#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 themaven.compiler.releaseproperty thatUpgradeToJava17adds.One change is specific to 10.x: the root pom manages
com.fasterxml.jackson.core:jackson-databindat 2.14.3, which also reachedwicket-migration, whilerewrite-mavenbringsjackson-dataformat-xml2.17.2. With the test enabled, reading the Maven settings failed withNoSuchMethodError: PropertyName.merge(...)before the recipe ran.wicket-migrationnow managesjackson-databindat 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, butversionPatternstill in place:Without the Jackson pin the test errors instead:
Test after the fix
A full
mvn clean verify -Pjs-testis green locally; japicmp reports nothing.Quickstart
MigrateToWicket10from the releasedwicket-migration:10.12.0, run throughrewrite-maven-plugin6.46.1 on a 9.25.0 quickstart, leaveswicket.versionat 9.25.0 while the addedwicket-testergets 10.12.0. A local copy of the recipe withoutversionPatternsetswicket.versionto 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