SeamFramework.orgCommunity Documentation

Chapter 3. Getting Started

3.1. Maven dependency configuration
3.2. Transitive dependencies
3.3. Pre-Servlet 3.0 configuration

Getting started with Solder is easy. All you need to do is put the API and implementation JARs on the classpath of your CDI application. The features provided by Solder will be enabled automatically.

Some additional configuration, covered at the end of this chapter, is required if you are using a pre-Servlet 3.0 environment.

If you are using Maven as your build tool, first make sure you have configured your build to use the JBoss Community repository, where you can find all the Seam artifacts. Then, add the following dependencies to your pom.xml file to get started using Solder:


<dependency>
   <groupId>org.jboss.solder</groupId>
   <artifactId>solder-api</artifactId>
   <version>${solder.version}</version>
   <scope>compile</scope>
</dependency>

<dependency>
   <groupId>org.jboss.solder</groupId>
   <artifactId>solder-impl</artifactId>
   <version>${solder.version}</version>
   <scope>runtime</scope>
</dependency>

Tip

Substitute the expression ${solder.version} with the most recent or appropriate version of Solder. Alternatively, you can create a Maven user-defined property to satisfy this substitution so you can centrally manage the version.

In a Servlet 3.0 or Java EE 6 environment, your configuration is now complete!

Most of Solder has very few dependencies, only one of which is not provided by Java EE 6:

Some features of Solder require additional dependencies (which are declared optional, so will not be added as transitive dependencies):

In addition, a logger implementation (SLF4J, Log4J, JBoss Log Manager or the JDK core logging facility) is required. Refer to Chapter 8, Logging, redesigned for more information about how logging is handled in Solder.

If you are using Java EE 5 or some other Servlet 2.5 container, then you need to manually register a Servlet component in your application's web.xml to access resources from the Servlet Context.


<listener>
   <listener-class>org.jboss.solder.resourceLoader.servlet.ResourceListener</listener-class>
</listener>

This registration happens automatically in a Servlet 3.0 environment through the use of a /META-INF/web-fragment.xml included in the Solder implementation.

You're all setup. It's time to dive into all the useful stuff that Solder provides!