Contexts & Dependency Injection for Java

CDI 2.0 is in public review

Posted by Antoine Sabot-Durand on Feb 01, 2017 | Comments

CDI 2.0 is now in public review status, you can now grab the PRD of the spec ot download the Javadoc.

Major features included in CDI 2.0

This CDI 2.0 includes important changes for the platform.

A lot of other small feature will be delivered. Refer to the coming release notes to check them all.

RI is also available

We also provide a pre-release for the RI and API, thus You can start testing CDI 2.0 with Weld 3.0 CR1 that you can download here.

To develop your CDI 2.0 code just switch cdi-api in your pom.xml to this version:

<dependency>
    <groupId>javax.enterprise</groupId>
    <artifactId>cdi-api</artifactId>
    <version>2.0-PFD</version>
</dependency>

We also provide a patch for WildFly 10.1.0 to help users evaluate CDI 2.0 under a Java EE application server.

To do so just download and unzip WildFly 10.1.0.Final, then download the patch (no need to unzip it), go to the <WILDFLY_HOME>/bin directory and patch the server with the following command:

./jboss-cli.sh --command="patch apply <PATH_TO_PATCH>/wildfly-10.1.0.Final-weld-3.0.0.CR1-patch.zip"

you should obtain the following result in the console:

{
    "outcome" : "success",
    "result" : {}
}

Your WildFly server is now patched to use CDI 2.0 and Weld 3.0 CR1.

Happy testing!