This is an automated email from the ASF dual-hosted git repository.
dashorst pushed a commit to branch wicket-10.x
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/wicket-10.x by this push:
new ca3b80e718 Let MigrateToWicket10 upgrade the org.apache.wicket
dependencies
ca3b80e718 is described below
commit ca3b80e718516442dcd893d68647f89460e3306e
Author: Martijn Dashorst <[email protected]>
AuthorDate: Sun Nov 1 00:13:40 2026 +0100
Let MigrateToWicket10 upgrade the org.apache.wicket dependencies
MigrateToWicket10 ends with an UpgradeDependencyVersion step for
org.apache.wicket:* that carries versionPattern: -SNAPSHOT. OpenRewrite
discards snapshot, milestone and release candidate versions before it
applies a versionPattern, so the 10.x range combined with -SNAPSHOT
matches no version at all, whether the project resolves from a release
or a snapshot repository. The step never changed anything. 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 ad4a76cd0c on master.
GitHub issue #1738
See also GitHub issue #1739 and pull request #1740 for master
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
wicket-migration/pom.xml | 5 +++++
wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml | 1 -
.../java/org/apache/wicket/migration/MigrateToWicket10Test.java | 9 +++++----
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/wicket-migration/pom.xml b/wicket-migration/pom.xml
index 5783011233..2f81d8d8aa 100644
--- a/wicket-migration/pom.xml
+++ b/wicket-migration/pom.xml
@@ -11,6 +11,11 @@
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.17.2</version>
+ </dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
diff --git a/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
b/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
index f05e61d261..1d78b7f5f0 100644
--- a/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
+++ b/wicket-migration/src/main/resources/META-INF/rewrite/wicket.yml
@@ -35,7 +35,6 @@ recipeList:
groupId: org.apache.wicket
artifactId: "*"
newVersion: 10.x
- versionPattern: -SNAPSHOT
- org.openrewrite.maven.UpgradeDependencyVersion:
groupId: org.apache.wicket.experimental.wicket9
artifactId: "*"
diff --git
a/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
b/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
index 6bce2f1c57..91fb6007a3 100644
---
a/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
+++
b/wicket-migration/src/test/java/org/apache/wicket/migration/MigrateToWicket10Test.java
@@ -16,7 +16,6 @@
package org.apache.wicket.migration;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openrewrite.config.Environment;
import org.openrewrite.java.JavaParser;
@@ -78,7 +77,6 @@ class MigrateToWicket10Test implements RewriteTest {
}
@Test
- @Disabled("Requires first release of 10.x before we can update the
version")
void migrateDependencies() {
//language=xml
rewriteRun(
@@ -104,7 +102,7 @@ class MigrateToWicket10Test implements RewriteTest {
</project>
""",
spec -> spec.after(pom -> {
- Matcher version =
Pattern.compile("10\\..+").matcher(pom);
+ Matcher version =
Pattern.compile("<version>(10\\.[^<]+)</version>").matcher(pom);
assertThat(version.find()).describedAs("Expected 10.x in %s", pom).isTrue();
return String.format("""
<project>
@@ -112,6 +110,9 @@ class MigrateToWicket10Test implements RewriteTest {
<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>
@@ -120,7 +121,7 @@ class MigrateToWicket10Test implements RewriteTest {
</dependency>
</dependencies>
</project>
- """, version.group(0));
+ """, version.group(1));
})
)
)