Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Java Groovy
Branch: master

CDI via JBoss Weld

Plugin page:

Enables the usage of Weld as Dependency Injection provider, and much more!


Weld will automatically autowire all dependencies marked with @javax.inject.Inject. The plugin also allows you to define additional beans, interceptors and alternatives in the standard beans.xml file located in griffon-app/conf/metainf.

Every instance created using the framework's facilities (in other words, those those that trigger a 'NewInstance' event) will also participate in the benefits of Weld managed injections. This means you annotate controller, models, and pretty much any artifact supported by Griffon.

There are two properties added to the application instance

  • weld - of type
  • weldContainer - of type

Addons can inject beans during startup. The Weld addon published an event named "BeforeWeld" that can be used to define a set of beans to be added to the BeanManager. Here's how the DataSource plugin does it to inject the default datasource

    def events = [
        BeforeWeld: { Map beans ->
            beans.dataSource = DataSourceHolder.instance.getDataSource('default')


A trivial sample application can be found at

Something went wrong with that request. Please try again.