== javaee
:idprefix: id_ 

This addon provides *standalone* functionality, and *exports services* for use in other addons. 
The javaee addon enables creation of artifacts (classes, descriptors) with focus on the Java EE 6 specification (CDI, JSF, JMS, JPA, etc...) 
        
=== Depends on

[options="header"]
|===
|Addon |Exported |Optional

|ui
|no
|no

|templates
|no
|no

|projects
|yes
|no

|parser-java
|yes
|no

|org.jboss.forge.furnace.container:cdi
|no
|no

|===

== Setup

This Addon requires the following installation steps.

=== Add configuration to pom.xml 

To use this addon, you must add it as a dependency in the *pom.xml* of your `forge-addon` classified artifact:

[source,xml]
----
<dependency>
   <groupId>org.jboss.forge.addon</groupId>
   <artifactId>javaee</artifactId>
   <classifier>forge-addon</classifier>
   <version>${version}</version>
</dependency>
----

== Features

Projects addon integration::
   This addon provides several `ProjectFacet` implementations for use in developing `forge-addon` projects. By using the javaee addon, it is possible to add Java EE capabilities to a specific project by adding the required technology as a provided dependency in the build descriptor.
+
Descriptors are handled by the https://github.com/shrinkwrap/descriptors[ShrinkWrap Descriptors] project. Read the Facets addon README to learn how to handle facets in Forge. Below is a table that lists each facet and its purpose.
+
[options="header,asciidoc"]
|===
|Facet|Behavior when installing in a project

|`CDIFacet`
|Adds the necessary CDI 1.x dependencies to the build descriptor. Adds a `META-INF/beans.xml` to your resources directory or to `WEB-INF/beans.xml` if in a Web project. The facet provides access to the `BeansDescriptor` object to allow manipulation of the `beans.xml` file in a fluent way.

|`EJBFacet`
|Adds the necessary EJB 3.x dependencies to the build descriptor. 

|`JAXWSFacet`
|Adds the necessary JAX-WS dependencies to the build descriptor. 

|`JMSFacet`
|Adds the necessary JMS 1.1 dependencies to the build descriptor. 

|`JSTLFacet`
|Adds the necessary JSTL dependencies to the build descriptor. 

|`JTAFacet`
|Adds the necessary JTA dependencies to the build descriptor. 

|`PersistenceFacet`
|Adds the necessary JPA 2.x dependencies to the build descriptor. Adds a `META-INF/persistence.xml` to your project. Provides access to the `PersistenceDescriptor` object to allow manipulation of the `persistence.xml` file in a fluent way. 

|`PersistenceMetaModelFacet`
|Adds the necessary configuration in the build descriptor to enable JPA 2.x meta-model generation. 

|`ServletFacet`
|Adds the necessary Servlet 3.x dependencies to the build descriptor. Adds a `WEB-INF/web.xml` to your project. Provides access to the `WebAppDescriptor` object to allow manipulation of the `web.xml` file in a fluent way. 

|===

JPA configuration :: 
 The javaee addon supports out-of-the-box configuration of the following JPA containers:
+
[options="header"]
|===
|Container|Tested Version(s) (Where applicable)

|JBoss WildFly
|-

|JBoss AS
|6.x / 7.x

|JBoss EAP
|6.x / 6.1.x

|Oracle WebLogic
|12c

|Oracle GlassFish
|3.x

|TomEE
|1.5.x

|SAP Lean Java Server
|-

|Non-JTA Container
|-

|Custom JDBC container
|-

|Custom JTA container
|-

|===
 
+
And the following JPA Providers:
+
- Hibernate 
- EclipseLink
- OpenJPA
- Infinispan

+