O'Reilly logo

Java EE 7 Developer Handbook by Peter A. Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the DeltaSpike CDI container tests

Let us take a different tack. Although there is no standard API for using CDI outside of a Java EE environment such as standalone Java SE, there is a project called DeltaSpike. This is an open source project that defines a wrapper API around two common CDI implementations JBoss Weld and Apache Open Web Beans. The URL is http://deltaspike.apache.org/.

Let us modify the Gradle build script to add dependencies for the Weld container as follows:

// Define equivalent Maven GAV coordinates. group = 'com.javaeehandbook.book1' archivesBaseName = 'ch02-cdi-standalone' version = '1.0' ext.deltaspikeVersion = '0.3-incubating' dependencies { compile 'org.jboss.weld.se:weld-se-core:1.1.9.Final' compile 'org.slf4j:slf4j-simple:1.6.1' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required