Skip to content

Commit 83f0e68

Browse files
evie-lautimtebeek
andauthored
Add recipe to replace jakarta jws-api with ws-api in EE10 (#1151)
* Add recipe to replace jakarta jws-api with ws-api in EE10 * Add test for removing jws-api for EE10 recipe * Update recipes.csv * Use ChangeDependency for in-place jws-api replacement; assert exact replacement in test * Keep AddDependency fallback for transitive jakarta.jws-api * Use AssertJ assertion verifying 4.x version instead of pinning exact patch --------- Co-authored-by: Tim te Beek <tim@moderne.io>
1 parent 48213f6 commit 83f0e68

3 files changed

Lines changed: 120 additions & 4 deletions

File tree

src/main/resources/META-INF/rewrite/jakarta-ee-10.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ description: Update Jakarta EE XML Web Services Dependencies for EE 10.
465465
preconditions:
466466
- org.openrewrite.Singleton
467467
recipeList:
468+
- org.openrewrite.java.migrate.jakarta.ReplaceJakartaJwsWithJakartaXmlWs
468469
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
469470
groupId: jakarta.xml.bind
470471
artifactId: jakarta.xml.bind-api
@@ -483,6 +484,33 @@ recipeList:
483484
newVersion: 4.x
484485
---
485486
type: specs.openrewrite.org/v1beta/recipe
487+
name: org.openrewrite.java.migrate.jakarta.ReplaceJakartaJwsWithJakartaXmlWs
488+
displayName: Replace `jakarta.jws-api` with `jakarta.xml.ws-api`
489+
description: >-
490+
Starting with Jakarta EE 10, the standalone `jakarta.jws-api` artifact was retired
491+
and its content was merged into `jakarta.xml.ws-api`. This recipe replaces a declared
492+
`jakarta.jws:jakarta.jws-api` dependency in place with `jakarta.xml.ws:jakarta.xml.ws-api`,
493+
and adds `jakarta.xml.ws:jakarta.xml.ws-api` directly when `jakarta.jws` was only
494+
available transitively.
495+
preconditions:
496+
- org.openrewrite.Singleton
497+
recipeList:
498+
- org.openrewrite.java.dependencies.ChangeDependency:
499+
oldGroupId: jakarta.jws
500+
oldArtifactId: jakarta.jws-api
501+
newGroupId: jakarta.xml.ws
502+
newArtifactId: jakarta.xml.ws-api
503+
newVersion: 4.0.x
504+
# Fallback for when jakarta.jws-api was only available transitively; ChangeDependency
505+
# above handles the in-place replacement of a declared dependency.
506+
- org.openrewrite.java.dependencies.AddDependency:
507+
groupId: jakarta.xml.ws
508+
artifactId: jakarta.xml.ws-api
509+
version: 4.0.x
510+
onlyIfUsing: jakarta.jws..*
511+
acceptTransitive: true
512+
---
513+
type: specs.openrewrite.org/v1beta/recipe
486514
name: org.openrewrite.java.migrate.jakarta.UpdateJerseyDependencies
487515
displayName: Update GlassFish Jersey Dependencies to 3.1.x
488516
description: Update GlassFish Jersey Dependencies to 3.1.x.

0 commit comments

Comments
 (0)