Skip to content

WireMock 4 migration: move Jetty EE10 to EE11 and bump to 4.0.0-beta.40 - #1184

Merged
timtebeek merged 2 commits into
openrewrite:mainfrom
sullis:wiremock4-jetty-ee11
Oct 12, 2026
Merged

timtebeek merged 2 commits into
openrewrite:mainfrom
sullis:wiremock4-jetty-ee11

Conversation

@sullis

@sullis sullis commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What's changed

  • Jetty EE10 → EE11. WireMock 3's wiremock-jetty12 ran on Jetty EE10, but WireMock 4.x (already as of beta.38) runs on EE11. For example, NotFoundHandler(...) now takes an org.eclipse.jetty.ee11.servlet.ServletContextHandler. The previous jetty-ee10-webapp AddDependency kept EE10 code compiling, but left a mixed EE10/EE11 classpath where EE10 objects can't be passed to WireMock APIs.
    • New MigrateJettyEe10ToEe11 sub-recipe, run from Wiremock3to4Migration before the WireMock dependency changes:
      • changes the org.eclipse.jetty.ee10 packages to ee11
      • changes the jetty-ee10-servlet/-servlets/-webapp dependencies to their EE11 counterparts
      • adds jetty-ee11-webapp and jetty-ee11-servlets when they're used, since WireMock 4 only puts them on the runtime classpath. These match on the ee10 packages because AddDependency checks onlyIfUsing against the sources as they were before ChangePackage ran.
    • The sub-recipe only runs in modules depending on wiremock-jetty12, where EE10 came in through WireMock. Modules with their own unrelated Jetty EE10 usage are left alone.
    • Removed the old jetty-ee10-webapp AddDependency.
  • Bump pinned version 4.0.0-beta.38 → 4.0.0-beta.40. I compared the class lists of wiremock-core, -jetty, -httpclient-apache5, -url, -junit4 and -junit5: beta.40 only adds classes, and every ChangeType target still exists.

Tests

New cases in Wiremock3to4MigrationTest:

  • jettyEe10MovesToEe11AlongsideWiremockJetty12: EE10 imports and dependencies move to EE11 when the module uses wiremock-jetty12.
  • jettyEe11WebappAddedWhenEe10OnlyCameThroughWiremockJetty12: jetty-ee11-webapp is added when EE10 was only available transitively through WireMock.
  • jettyEe10UntouchedWithoutWiremockJetty12: modules without wiremock-jetty12 keep their EE10 code and dependencies.

These tests haven't run yet. The build resolves its Gradle plugins and rewrite-* jars from artifacts.codegenomeproject.org, which returns HTTP 401 without credentials. That fails both locally and in this PR's CI run, during project configuration and before any tests start. A maintainer may need to re-run CI with credentials.

recipes.csv doesn't have a row for MigrateJettyEe10ToEe11 yet; it may need regenerating.

🤖 Generated with Claude Code

…beta.40

WireMock 3's `wiremock-jetty12` ran on Jetty EE10, whereas WireMock 4.x runs on EE11
(e.g. `NotFoundHandler` now takes an `ee11.servlet.ServletContextHandler`). Adding
`jetty-ee10-webapp` left a mixed EE10/EE11 classpath, so instead move EE10 packages and
dependencies to EE11 in modules depending on `wiremock-jetty12`, and add the runtime-only
`jetty-ee11-webapp` / `jetty-ee11-servlets` modules when used directly.

Also bump the pinned WireMock version to 4.0.0-beta.40, which is purely additive over beta.38.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sullis
sullis force-pushed the wiremock4-jetty-ee11 branch from 787b47c to 05f665d Compare October 11, 2026 23:06
@timtebeek
timtebeek merged commit 085944c into openrewrite:main Oct 12, 2026
1 check failed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants