Skip to main content

Jakarta Contexts and Dependency Injection 5.0 (Under development)

Release for Jakarta EE 12

Jakarta Contexts Dependency Injection specifies a means for obtaining objects in such a way as to maximize reusability, testability and maintainability compared to traditional approaches such as constructors, factories, and service locators (e.g., JNDI).

A complete list of issues and pull requests for this version can be viewed using CDI 5.0 Milestone and CDI TCK 5.0 Milestone in their respective GitHub repositories.

New features, enhancements or additions

  • Increase minimal Java version to 17
  • Introduction of @Reserve annotation as a means of declaring a default bean
  • Introduction of @Eager annotation for eager initialization of @ApplicationScoped beans
  • Introduction of @AutoClose annotation for automatic invocation of close() on AutoCloseable beans during destruction
  • Introduction of asynchronous invokers via the AsyncHandler API
  • Introduction of synthetic bean injection points via SyntheticInjections
  • Introduction of global scopes; application scope is now global
  • Allow registering BuildCompatibleExtension programmatically in CDI SE
  • Allow specifying parameterized types in @Registration
  • Define how InjectionPoint works when a bean is obtained via CDI.current()
  • Introduction of tests for unproxyability of sealed classes
  • Introduction of tests for records in the TCK lang model
  • Multiple small specification clarifications

Removals, deprecations or backwards incompatible changes

  • Change of Maven GAV coordinates — both groupId and artifactId changed for CDI API and CDI TCK artifacts
    • E.g. jakarta.enterprise:jakarta.enterprise.cdi-api is now jakarta.cdi:jakarta.cdi-api
    • CDI API provides relocation artifacts for the 5.0 release to ease migration
    • CDI TCK coordinates changed as well but without relocation artifacts
  • Removal of SecurityManager usage and references
  • Removal of deprecated methods from BeanManager API
    • These are methods related to EL and are replaced in ELAwareBeanManager since CDI 4.1
  • Forbid using trimming in non-explicit bean archives
  • Deprecation for removal of existing SyntheticBeanCreator and SyntheticBeanDisposer methods in favor of new methods using SyntheticInjections

Minimum Java SE Version

Java SE 17 or higher

Details

Compatible Implementations

Ballots

Release Review

The Specification Committee Ballot is TBD.

The ballot was run in the jakarta.ee-spec mailing list

Plan Review

This Specification Project’s Plan Review will be covered by the CDI 5.0 Plan Review.

The Specification Committee Ballot concluded successfully on 2025-03-24 with the following results.

Representative Representative for: Vote
Kenji Kazumura Fujitsu +1
Emily Jiang, Tom Watson IBM +1
Ed Bratt, Dmitry Kornilov Oracle +1
Andrew Pielage, Petr Aubrecht Payara +1
David Blevins, Jean-Louis Monteiro Tomitribe no vote
Ivar Grimstad EE4J PMC +1
Marcelo Ancelmo, Abraham Marin-Perez Participant Members +1
Werner Keil Committer Members +1
Jun Qian Enterprise Members no vote
Zhai Luchao Enterprise Members +1
Total 8

Non-binding Votes

Representative Representative for: Vote
Angelo Rubini Community +1
Total 1

The ballot was run on the jakarta.ee-spec mailing list