Skip to content

The Jakarta JAXB migration upgrades EclipseLink MOXy to 3.0 - #1270

Merged
jkschneider merged 1 commit into
jakarta/persistence-descriptor-namespacefrom
jakarta/moxy-3
Oct 4, 2026
Merged

jkschneider merged 1 commit into
jakarta/persistence-descriptor-namespacefrom
jakarta/moxy-3

Conversation

@jkschneider

Copy link
Copy Markdown
Member

MOXy 2.x implements javax.xml.bind, so its JAXBContextFactory.createContext returns a javax.xml.bind.JAXBContext that the migrated callers can no longer assign to jakarta.xml.bind.JAXBContext. JavaxXmlBindMigrationToJakartaXmlBind now upgrades org.eclipse.persistence:org.eclipse.persistence.moxy to 3.0.x, the first line built on Jakarta XML Binding 3, with UpgradeDependencyVersion, so a newer MOXy is kept. A build that also pins org.eclipse.persistence.core 2.x beside MOXy is not handled, since none of the repositories had one.

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 moxy-2-retained 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:

The JAXB migration retains MOXy 2 whose factory and annotations use javax JAXB. (arquillian/arquillian-recorder, arquillian-recorder-reporter/arquillian-recorder-reporter-api/pom.xml, recipe org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta)

Before:

MOXy 2.5.1; javax.xml.bind.JAXBContext c = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(new Class[]{A.class}, null);

What the recipe produced:

MOXy 2.5.1; jakarta.xml.bind.JAXBContext c = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(new Class[]{A.class}, null);

Expected:

MOXy 3.0.4; jakarta.xml.bind.JAXBContext c = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(new Class[]{A.class}, null);

Stacked on #1269 (7 of 19); merge that one first.

@jkschneider
jkschneider added this pull request to stack #1284 October 4, 2026 09:43
@jkschneider
jkschneider merged commit b819b72 into main Oct 4, 2026
1 check passed
@jkschneider
jkschneider deleted the jakarta/moxy-3 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

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant