Skip to content

The Jakarta XML Web Services migration adds jakarta.xml.ws-api for imports the parser could not resolve - #1266

Merged
jkschneider merged 1 commit into
jakarta/annotation-api-for-importsfrom
jakarta/jaxws-api-for-imports
Oct 4, 2026
Merged

jkschneider merged 1 commit into
jakarta/annotation-api-for-importsfrom
jakarta/jaxws-api-for-imports

Conversation

@jkschneider

Copy link
Copy Markdown
Member

Java 8 ships JAX-WS as well, so javax.xml.ws imports in Java 8 LSTs are unresolved, and JavaxXmlWsMigrationToJakartaXmlWs moved them to jakarta.xml.ws without adding jakarta.xml.ws-api, because it only relocates an existing API dependency and its AddDependency (for jaxws-rt) needs resolved types. It now runs AddApiDependencyForImports (the #1257 recipe as generalized at the bottom of this stack) for jakarta.xml.ws and 3.0.x. The step that changed jakarta.xml.ws-api to provided scope in every build is removed, because on the next cycle it demoted the API this recipe had just added, so an existing API dependency now keeps its declared scope.

Found by a team of coding agents reviewing a Moderne run of org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta over the 31 Arquillian repositories (run 20261003120559-YQoma). The issue is jaxws-api-dependency-missing in the run's io.moderne.RecipeIssues data table (1 row), and the fix was discussed and reviewed on the run's message board. A row from the table, as a generalized example:

Migrating JDK 8 JAX-WS imports without adding the Jakarta API dependency breaks compilation. (arquillian/arquillian-algeron, consumer/core/pom.xml, recipe org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta)

Before:

import javax.xml.ws.http.HTTPException; class A { HTTPException error; } // no JAX-WS dependency

What the recipe produced:

import jakarta.xml.ws.http.HTTPException; class A { HTTPException error; } // no JAX-WS dependency

Expected:

import jakarta.xml.ws.http.HTTPException; class A { HTTPException error; } // dependency jakarta.xml.ws:jakarta.xml.ws-api:3.0.1

Stacked on #1265 (3 of 19); merge that one first.

@jkschneider
jkschneider force-pushed the jakarta/jaxws-api-for-imports branch from 01b641d to 9beeb73 Compare October 3, 2026 22:26
@jkschneider
jkschneider added this pull request to stack #1284 October 4, 2026 09:43
@jkschneider
jkschneider merged commit babdd67 into main Oct 4, 2026
1 check passed
@jkschneider
jkschneider deleted the jakarta/jaxws-api-for-imports branch October 4, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant