Description
Weld is the reference implementation of CDI: Contexts and Dependency Injection for the Java EE Platform which is the Java standard for dependency injection and contextual lifecycle management and one of the most important and popular parts of the Java EE platform.
Weld is integrated into many Java EE application servers such as WildFly, JBoss Enterprise Application Platform, GlassFish, Oracle WebLogic and others. Weld can also be used in a Servlet-only environment (Tomcat, Jetty) or plain Java SE environment.
See http://weld.cdi-spec.org for more details.
Weld alternatives and similar libraries
Based on the "Dependency Injection" category.
Alternatively, view Weld alternatives based on common mentions on social networks and blogs.
-
Guice
Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google. -
Governator
Governator is a library of extensions and utilities that enhance Google Guice to provide: classpath scanning and automatic binding, lifecycle management, configuration to field mapping, field validation and parallelized object warmup.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Weld or a related project?
Popular Comparisons
README
Weld
Weld is the reference implementation of CDI: Contexts and Dependency Injection for the Java EE Platform which is the Java standard for dependency injection and contextual lifecycle management and one of the most important and popular parts of the Java EE platform.
Weld is integrated into many Java EE application servers such as WildFly, JBoss Enterprise Application Platform, GlassFish, Oracle WebLogic and others. Weld can also be used in a Servlet-only environment (Tomcat, Jetty) or plain Java SE environment.
See http://weld.cdi-spec.org for more details.
Building Weld
To build Weld simply run
$ mvn clean install
Upgrading Weld in WildFly
Firstly, set the JBOSS_HOME
environment property to point to your WildFly installation which already contains Weld 3 in older version:
$ export JBOSS_HOME=/opt/wildfly
Then, run the upgrade script:
$ mvn package -Pupdate-jboss-as -f jboss-as/pom.xml -Dweld.update.version=${weld.version}
In the above snippet, ${weld.version}
is the version of Weld you want to use.
Now you should have patched WildFly in JBOSS_HOME
.
Running integration tests and the TCK on WildFly
Follow the steps above to set the JBOSS_HOME environment property and to upgrade Weld within WildFly. Then, run:
$ mvn clean verify -Dincontainer -f tests-arquillian/pom.xml
$ mvn clean verify -Dincontainer -f jboss-tck-runner/pom.xml
If you want to run a specific test you can use the -Dtest=<test_name>
flag. For example
$ mvn clean verify -Dincontainer -f jboss-tck-runner/pom.xml -Dtest=FireEventTest
Will run all the tests defined in FireEventTest
.
$ mvn clean verify -Dincontainer -f jboss-tck-runner/pom.xml -Dtest=FireEventTest#testInjectedEventAcceptsEventObject
Will only run the FireEventTest.testInjectedEventAcceptsEventObject()
test method.
*Note that all licence references and agreements mentioned in the Weld README section above
are relevant to that project's source code only.