You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

CODI Module Overview

MyFaces CODI consists of the following modules:

Required modules:

  • Core

Optional modules:

  • JEE/JSF (for 1.2 and 2.x)
  • JEE/BV
  • JEE/JPA
  • JSE/Message (advanced I18N)
  • JSE/Scripting

Configuration - Getting Started

It's quite easy to add CODI to your project. Just add the core as well as the module/s of your choice to the pom.xml of your project.

With JEE6+

If you are using CODI in a JEE6 environment, you don't need to configure a CDI implementation explicitly because it's shipped with the container. For some JEE6 application servers it's suggested to use the all-in-one dist package instead of the fine grained modules (due to server related issues).

Without JEE6+

Don't forget to setup the CDI implementation of your choice. If you would like to use CODI in combination with OpenWebBeans, you can also use the archetype provided by MyFaces.

Archetype for creating a Hello-World CODI/OWB Demo
mvn archetype:generate -DarchetypeCatalog=http://myfaces.apache.org

CODI-Core Module (required)

CODI-Core module dependencies
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
    <artifactId>myfaces-extcdi-core-api</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
    <artifactId>myfaces-extcdi-core-impl</artifactId>
    <version>${codi.version}</version>
    <scope>runtime</scope>
</dependency>

CODI JSF Modules

CODI for JSF 1.2 (optional)

CODI-JSF 1.2 module dependencies
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-jsf12-module-api</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-jsf12-module-impl</artifactId>
    <version>${codi.version}</version>
    <scope>runtime</scope>
</dependency>

CODI for JSF 2.0 or 2.1 (optional)

CODI-JSF 2.0 module dependencies
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
    <version>${codi.version}</version>
    <scope>runtime</scope>
</dependency>

CODI Bean-Validation (JSR-303) Module (optional)

CODI-BV 1.0 module dependencies
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-bv1-module-api</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-bv1-module-impl</artifactId>
    <version>${codi.version}</version>
    <scope>runtime</scope>
</dependency>

CODI Scripting (JSR-223) Module (optional)

CODI-Scripting module dependencies
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-scripting-module-api</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-scripting-module-impl</artifactId>
    <version>${codi.version}</version>
    <scope>runtime</scope>
</dependency>

CODI Message (Advanced I18N) Module (optional)

CODI-Message module dependencies
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-message-module-api</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
    <artifactId>myfaces-extcdi-message-module-impl</artifactId>
    <version>${codi.version}</version>
    <scope>runtime</scope>
</dependency>

Hint
Replace the placeholders for the version with the version of your choice or use:

Optional properties
<properties>
    <codi.version>1.0.0-SNAPSHOT</codi.version>
</properties>

Hint
If you would like to test CODI or you need all modules provided by CODI, you can use an all-in-one JAR file.

OPTIONAL all-in-one dependency for JSF 1.2 projects
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi</groupId>
    <artifactId>myfaces-extcdi-dist-jsf12</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>

or

OPTIONAL all-in-one dependency for JSF 2.0 projects
<dependency>
    <groupId>org.apache.myfaces.extensions.cdi</groupId>
    <artifactId>myfaces-extcdi-dist-jsf20</artifactId>
    <version>${codi.version}</version>
    <scope>compile</scope>
</dependency>
  • No labels