Weld is the reference implementation of CDI: Contexts and Dependency Injection for the Java EE Platform - a JCP standard for dependency injection and contextual lifecycle management and one of the most important and popular parts of the Java EE. Weld is integrated into many Java EE application servers such as WildFly, JBoss Enterprise Application Platform, GlassFish, Oracle WebLogic Server, WebSphere Application Server and others. Weld can also be used in plain servlet containers (Tomcat, Jetty) or Java SE.
To use Weld today, download the
WildFly server
(formerly JBoss AS) and add the following code to the
pom.xml
file of your application:
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>2.0.2</version>
<scope>provided</scope>
</dependency>
For alternative ways of using Weld, see the download section or the reference documentation.
Each version of WildFly is shipped with given version of Weld. However, WildFly and Weld have different release cadences. Therefore, with every Weld release we also create a patch which allows you to easily upgrade:
WildFly | Ships with Weld | Available Patches |
---|---|---|
WildFly 21.0.2.Final | Weld 3.1.5.Final CDI 2.0 |
|
WildFly 22.0.0.Beta1
Preview EE 9 |
Weld 4.0.0.CR1 CDI 3.0 |
|
WildFly 20.0.1.Final | Weld 3.1.4.Final CDI 2.0 |
|
WildFly 20.0.1.Final | Weld 3.1.4.Final CDI 2.0 |
|
WildFly 19.0.0.Final | Weld 3.1.3.Final CDI 2.0 |
|
WildFly 18.0.1.Final | Weld 3.1.2.Final CDI 2.0 |
|
WildFly 17.0.1.Final | Weld 3.1.1.Final CDI 2.0 |
|
WildFly 16.0.0.Final | Weld 3.1.0.Final CDI 2.0 |
|
WildFly 15.0.1.Final | Weld 3.0.5.Final CDI 2.0 |
|
WildFly 14.0.1.Final | Weld 3.0.5.Final CDI 2.0 |
|
WildFly 13.0.0.Final | Weld 3.0.4.Final CDI 1.2 and CDI 2.0 (opt-in via property) |
|
WildFly 12.0.0.Final | Weld 3.0.3.Final CDI 1.2 and CDI 2.0 (opt-in via property) | |
WildFly 11.0.0.Final | Weld 2.4.3.Final CDI 1.2 |
|
WildFly 10.1.0.Final | Weld 2.3.5.Final CDI 1.2 |
|
If you’re not familiar with patching WildFly, check the FAQ. |
Weld 6.0.0.CR1 is now available
Squashing bugs with Weld 5.1.3.Final!
Weld 6.0.0.Beta4 is now available
Weld 6.0.0.Beta1 is now available
Weld 6.0.0.Alpha1 is now available