rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

Recipe for upgrading to Jetty 12.0.16 version

Open matosoma123 opened this issue 11 months ago • 2 comments

What problem are you trying to solve?

I am upgrading to jetty 12 version, I earlier had jetty 11 version, now my tests are all failing with 404 version, I am still struggling to understand how to upgrade to jetty 12, reading through the migration docs, this recipe would be very helpful for many.

What precondition(s) should be checked before applying this recipe?

Eclipse Jetty 12

Describe the situation before applying the recipe

Sorry, I am new to this, do not know.

Describe the situation after applying the recipe

Sorry, I am new to this, do not know.

Have you considered any alternatives or workarounds?

No.

Any additional context

No

Are you interested in contributing this recipe to OpenRewrite?

Sorry, I am new to this, I do not know, but, I am interested to explore...

matosoma123 avatar Jan 27 '25 12:01 matosoma123

Hi @matosoma123 👋 I think we need to break down the jetty upgrade to the needed steps before proceeding. Can you start by lining out what migration guide you are using and what's stated in there? From there, we can help you to start with building the smallest recipes first and get used to the process.

MBoegers avatar Jan 27 '25 13:01 MBoegers

I've found this migration guide showing a number of dependency, package and class changes, that should be fairly easy to add as declarative recipes: https://jetty.org/docs/jetty/12/programming-guide/migration/11-to-12.html

type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.JettyPackageChanges
displayName: Update Jetty package imports
description: Updates Jetty package imports to their new locations.
recipeList:
  - org.openrewrite.java.ChangePackage:
      oldPackageName: org.eclipse.jetty.client.api
      newPackageName: org.eclipse.jetty.client
      recursive: true
  - org.openrewrite.java.ChangePackage:
      oldPackageName: org.eclipse.jetty.client.util
      newPackageName: org.eclipse.jetty.client
      recursive: true
  - org.openrewrite.java.ChangePackage:
      oldPackageName: org.eclipse.jetty.client.http
      newPackageName: org.eclipse.jetty.client.transport
      recursive: true
  - org.openrewrite.java.ChangePackage:
      oldPackageName: org.eclipse.jetty.http2.client.http
      newPackageName: org.eclipse.jetty.http2.client.transport
      recursive: true

  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.annotation.OnWebSocketConnect
      newFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.annotation.OnWebSocketOpen
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.WriteCallback
      newFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.Callback
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.WebSocketListener
      newFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.Session.Listener.AutoDemanding
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.RemoteEndpoint
      newFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.Session
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.WebSocketPolicy
      newFullyQualifiedTypeName: org.eclipse.jetty.websocket.api.Configurable

timtebeek avatar May 04 '25 12:05 timtebeek

This issue is stale because it has not had any activity for 60 days. Remove question label or comment or this will be closed in two weeks. Issues may be reopened when there is renewed interest.

github-actions[bot] avatar Jul 28 '25 11:07 github-actions[bot]