dashorst opened a new issue, #1739:
URL: https://github.com/apache/wicket/issues/1739
The `org.apache.wicket.MigrateToWicket11` recipe in `wicket-migration` does
not upgrade the `org.apache.wicket` dependencies. A project on Wicket 10 keeps
its Wicket 10 `wicket-core` (and every other `org.apache.wicket` artifact),
while the other steps of the recipe do run: the Java 21 baseline, the type
changes, and the move of `wicket-metrics` to the
`org.apache.wicket.experimental.wicket11` groupId at 11.x. The result is a
project that mixes Wicket 10 core artifacts with Wicket 11 code changes and
modules, and the recipe reports no problem.
## Cause
`wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml` ends the
recipe with
```yaml
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: org.apache.wicket
artifactId: "*"
newVersion: 11.x
versionPattern: -SNAPSHOT
```
`versionPattern` restricts the candidate versions to those ending in
`-SNAPSHOT`. Release repositories contain none, so the step finds no candidate
and silently leaves the version alone. Removing `versionPattern` makes it
select the latest 11.x release.
Master's copy of `MigrateToWicket10` ends with the same step (`newVersion:
10.x`) and has the same defect; it is fixed in the same change on master. The
10.x line is tracked separately in #1738.
The existing test for the dependency upgrade,
`MigrateToWicket10Test#migrateDependencies`, is `@Disabled("Requires first
release of 10.x before we can update the version")`, so the step was never
exercised, and `MigrateToWicket11` has no dependency test at all.
## Reproduction
1. Generate a Wicket 10.12.0 quickstart (`wicket-archetype-quickstart`); its
pom has `<wicket.version>10.12.0</wicket.version>`.
2. Run the recipe from `wicket-migration` 11.0.0 (currently the release
candidate):
```
mvn org.openrewrite.maven:rewrite-maven-plugin:6.46.1:run \
-Drewrite.recipeArtifactCoordinates=org.apache.wicket:wicket-migration:11.0.0 \
-Drewrite.activeRecipes=org.apache.wicket.MigrateToWicket11
```
3. `wicket.version` is still `10.12.0`, while the compiler release is raised
to 21 and the `ICrypt` imports are rewritten.
With a local copy of the recipe without `versionPattern`, the same run sets
`wicket.version` to `11.0.0` and the migrated quickstart passes `mvn verify`.
## Affected
`wicket-migration` on master, including the 11.0.0 release candidate.
--
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]