Skip to content

The Jakarta migration upgrades Weld to 4.0, the Jakarta CDI 3 implementation - #1273

Merged
jkschneider merged 1 commit into
jakarta/validation-coordinate-literalfrom
jakarta/weld-4
Oct 3, 2026
Merged

jkschneider merged 1 commit into
jakarta/validation-coordinate-literalfrom
jakarta/weld-4

Conversation

@jkschneider

Copy link
Copy Markdown
Member

CDI imports moved to jakarta.enterprise while Weld stayed on 1.x or 2.x (org.jboss.weld:weld-core) or 3.x (weld-core-impl), all of which implement javax.enterprise, so a WeldManager no longer assigned to jakarta.enterprise.inject.spi.BeanManager. New declarative recipe WeldToJakarta, run after JavaxEnterpriseToJakartaEnterprise, changes org.jboss.weld:weld-core to weld-core-impl 4.0.x and upgrades weld-core-impl to 4.0.x, keeping the dependency's scope. Other Weld artifacts, such as the SE and servlet integrations, are not changed.

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 weld-javax-provider-retained in the run's io.moderne.RecipeIssues data table (2 rows), and the fix was discussed and reviewed on the run's message board. A row from the table, as a generalized example:

Retaining Weld 2 after migrating CDI types to Jakarta makes WeldManager and Extension signatures incompatible. (arquillian/arquillian-core, testenrichers/cdi/pom.xml, recipe org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta)

Before:

org.jboss.weld:weld-core:2.4.8.Final; javax.enterprise.inject.spi.BeanManager manager = weldManager;

What the recipe produced:

org.jboss.weld:weld-core:2.4.8.Final; jakarta.enterprise.inject.spi.BeanManager manager = weldManager;

Expected:

org.jboss.weld:weld-core-impl:4.0.3.Final; jakarta.enterprise.inject.spi.BeanManager manager = weldManager;

Stacked on #1272 (10 of 19); merge that one first.

@jkschneider
jkschneider added this pull request to stack #1283 October 3, 2026 22:39
@jkschneider
jkschneider merged commit 77a20ed into jakarta/reflective-type-names Oct 3, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 3, 2026
@jkschneider
jkschneider deleted the jakarta/weld-4 branch October 3, 2026 22:41
jkschneider added a commit that referenced this pull request Oct 4, 2026
#1271)

* javax-reflective-names-retained: migrate runtime Jakarta type names

* maven-coordinate-literal-retained: migrate validation artifact lookups (#1272)

* weld-javax-provider-retained: align Weld core with Jakarta CDI (#1273)

* `JettyUpgradeEE9` also upgrades the other Jetty dependencies, the servlet packages and the Java version (#1274)

* jetty-ee9-java-baseline: align Jetty dependencies packages and Java baseline

* jetty-ee9-java-baseline: leave standalone Jetty utility dependencies unchanged

* jetty-ee9-java-baseline: require a direct dependency before upgrading Java

* `JacksonJavaxToJakarta` keeps newer Jackson versions and shared version properties when relocating artifacts (#1275)

* jackson-version-downgrade: preserve newer versions and shared properties

* jackson-shared-version-property-split: cover older shared Jackson versions

* The Jakarta JAXB migration keeps the `javax.xml.bind` API for Arquillian Recorder 1.x binaries (#1276)

* recorder-javax-jaxb-api-removed: retain the API needed by Recorder binaries

* recorder-javax-jaxb-api-removed: limit retention to external binaries after migration

* hibernate-validator-javax-provider-retained: migrate legacy validation providers (#1277)

* legacy-javaee-api-coordinate-retained: migrate legacy annotation EL and EJB aliases (#1278)

* The Jakarta migration keeps a provided API provided instead of adding it again in compile scope (#1279)

* cdi-provided-scope-promoted: preserve provided CDI API scope

* cdi-provided-scope-promoted: distinguish provided declarations from runtime APIs

* provided-api-scope-overwritten: preserve provided Mail API scope

* provided-api-scope-overwritten: preserve container API scopes across Jakarta migrations

* The Jackson Jakarta migration adds the `defaultView` parameter to `ProviderBase._configForWriting` overrides (#1280)

* jackson-provider-override-signature: forward the default view parameter

* jackson-provider-override-signature: update callers of migrated overrides

* invocation-context-get-constructor-missing: complete legacy decorators (#1281)

* jakarta-api-duplicates-platform: respect provided platform APIs (#1282)
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