Enterprise Java Development@TOPIC@

Chapter 88. EAR Deployment

88.1. EAR Artifact
88.1.1. EAR META-INF/application.xml
88.2. EAR-based EJB Deployment
88.3. Maven Aspects: EAR
88.3.1. EAR Module Build
88.3.2. EAR Module Cleanup
88.3.3. IT Test Module
88.4. Summary
|-- ejb-basic-ejb.jar
`-- META-INF
    `-- application.xml
19:50:07,583 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named GreeterEJB in deployment unit subdeployment "ejb-basic-ejb.jar" of deployment "ejb-basic-ear-4.0.0-SNAPSHOT.ear" are as follows:

        java:global/ejb-basic-ear/ejb-basic-ejb/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote
        java:app/ejb-basic-ejb/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote
        java:module/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote
        java:jboss/exported/ejb-basic-ear/ejb-basic-ejb/GreeterEJB!info.ejava.examples.ejb.basic.ejb.GreeterRemote
        java:global/ejb-basic-ear/ejb-basic-ejb/GreeterEJB
        java:app/ejb-basic-ejb/GreeterEJB
        java:module/GreeterEJB

19:50:07,588 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: ejb-basic-ear-4.0.0-SNAPSHOT.ear
19:50:07,596 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment ejb-basic-ear-4.0.0-SNAPSHOT.ear


<project>
    <groupId>info.ejava.examples.ejb.basicejb</groupId>
    <artifactId>ejb-basic-ear</artifactId>
    <packaging>ear</packaging>

    <dependencies>
        <!-- The EAR must have a scope=compile dependency on the EJB -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>ejb-basic-ejb</artifactId>
            <version>${project.version}</version>
            <type>ejb</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- provide properties here to impact the EAR packaging -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <configuration>
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <!-- eliminates use of version in EAR JNDI name portion -->
                    <applicationName>${project.artifactId}</applicationName>
                    <modules>
                        <!-- eliminates use of the version in the EJB JNDI name -->
                        <ejbModule>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>ejb-basic-ejb</artifactId>
                            <bundleFileName>ejb-basic-ejb.jar</bundleFileName>
                        </ejbModule>
                    </modules>
                </configuration>
            </plugin>
        </plugins>
    </build>