dashorst opened a new pull request, #1740:
URL: https://github.com/apache/wicket/pull/1740
Fixes #1739.
The `MigrateToWicket10` and `MigrateToWicket11` recipes in
`wicket-migration` end with an `UpgradeDependencyVersion` step for
`org.apache.wicket:*` that carries `versionPattern: -SNAPSHOT`. That pattern
only accepts snapshot versions, which release repositories don't have, so the
step silently did nothing. A migrated project kept its old `wicket-core`, while
the other steps (Java baseline, type changes, the `wicket-metrics` groupId
move) did run. This PR removes the two `versionPattern` lines.
The tests:
- `MigrateToWicket10Test#migrateDependencies` is re-enabled. It had been
`@Disabled` until 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 the
`maven.compiler.release` property that `UpgradeToJava17` adds. It resolves
`10.x` from Maven Central, as before.
- `MigrateToWicket11Test` is new. 11.0.0 is not on Central yet, so the test
resolves `wicket-core` and `wicket-metrics` from a small file-based Maven
repository fixture next to the test (`maven-repository/`, pom-packaged poms
plus `maven-metadata-local.xml`). Central and `~/.m2` are 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'`):
```
[ERROR]
MigrateToWicket10Test.migrateDependencies:82->lambda$migrateDependencies$0:106
[Expected 10.x in <project>
...
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
<version>9.12.0</version>
</dependency>
...
[ERROR] MigrateToWicket11Test.migrateDependencies:76 [Unexpected result in
"any-project/pom.xml":
@@ -10,7 +10,7 @@
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
- <version>11.0.0</version>
+ <version>10.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.wicket.experimental.wicket11</groupId>
[ERROR] Tests run: 3, Failures: 2, Errors: 0, Skipped: 0
```
The 11 failure shows the mixed result: `wicket-metrics` has moved to
`experimental.wicket11` 11.0.0, `wicket-core` is still 10.12.0.
With the fix:
```
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 -- in
org.apache.wicket.migration.MigrateToWicket10Test
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- in
org.apache.wicket.migration.MigrateToWicket11Test
```
`mvn clean verify -Pjs-test` is green.
Quickstart runs with `rewrite-maven-plugin` 6.46.1:
| Recipe | Start | Released recipe | Recipe without `versionPattern` |
|---|---|---|---|
| `MigrateToWicket11` (wicket-migration 11.0.0 RC) | 10.12.0 quickstart |
`wicket.version` stays 10.12.0; metrics groupId, `ICrypt` and Java 21 steps
applied | `wicket.version` 11.0.0; migrated quickstart passes `mvn verify` |
| `MigrateToWicket10` (wicket-migration 10.12.0) | 9.25.0 quickstart |
`wicket.version` stays 9.25.0, while the added `wicket-tester` gets 10.12.0 |
`wicket.version` 10.12.0 |
## Scope
Master only for now. The 10.x and 11.0 release lines are left out on
purpose: the `wicket-10.x` fix 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](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]