Repository navigation
Conversation
…encies MigrateToWicket10 and MigrateToWicket11 end 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 project migrated with either recipe kept its old wicket-core and the other org.apache.wicket artifacts, while the remaining steps did run: the Java baseline, the type changes and, for MigrateToWicket11, the move of wicket-metrics to the experimental.wicket11 groupId at 11.x. The result was a project mixing old core artifacts with new code changes, and the recipe gave no sign of it. The versionPattern is removed from both steps, so they select the latest release of the target line. Running either 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. MigrateToWicket11Test is new and resolves wicket-core and wicket-metrics from a small file-based repository next to the test, with Maven Central and the local repository switched off, so it does not depend on what has been released. GitHub issue apache#1739 See also GitHub issue apache#1738 for wicket-10.x Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1740 +/- ##
============================================
- Coverage 63.17% 63.17% -0.01%
- Complexity 11558 11559 +1
============================================
Files 1253 1253
Lines 48635 48635
Branches 6844 6844
============================================
- Hits 30725 30724 -1
- Misses 15192 15193 +1
Partials 2718 2718 🚀 New features to boost your workflow:
|
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 #1739.
The
MigrateToWicket10andMigrateToWicket11recipes inwicket-migrationend with anUpgradeDependencyVersionstep fororg.apache.wicket:*that carriesversionPattern: -SNAPSHOT. That pattern only accepts snapshot versions, which release repositories don't have, so the step silently did nothing. A migrated project kept its oldwicket-core, while the other steps (Java baseline, type changes, thewicket-metricsgroupId move) did run. This PR removes the twoversionPatternlines.The tests:
MigrateToWicket10Test#migrateDependenciesis re-enabled. It had been@Disableduntil the first 10.x release and was never turned back on, which is how the defect went unnoticed. Its expectation is also corrected: the version regex captured the closing</version>tag, and the expected pom lacked themaven.compiler.releaseproperty thatUpgradeToJava17adds. It resolves10.xfrom Maven Central, as before.MigrateToWicket11Testis new. 11.0.0 is not on Central yet, so the test resolveswicket-coreandwicket-metricsfrom a small file-based Maven repository fixture next to the test (maven-repository/, pom-packaged poms plusmaven-metadata-local.xml). Central and~/.m2are switched off for that execution context, so the result does not depend on what has been released or installed locally.Before and after
Both tests against the unfixed recipe (
mvn verify -pl wicket-migration -Dtest='MigrateToWicket1*Test'):The 11 failure shows the mixed result:
wicket-metricshas moved toexperimental.wicket1111.0.0,wicket-coreis still 10.12.0.With the fix:
mvn clean verify -Pjs-testis green.Quickstart runs with
rewrite-maven-plugin6.46.1:versionPatternMigrateToWicket11(wicket-migration 11.0.0 RC)wicket.versionstays 10.12.0; metrics groupId,ICryptand Java 21 steps appliedwicket.version11.0.0; migrated quickstart passesmvn verifyMigrateToWicket10(wicket-migration 10.12.0)wicket.versionstays 9.25.0, while the addedwicket-testergets 10.12.0wicket.version10.12.0Scope
Master only for now. The 10.x and 11.0 release lines are left out on purpose: the
wicket-10.xfix is tracked in #1738 and is not part of this PR, and nothing here goes into the 11.0.0 release.🤖 Generated with Claude Code