In pom.xml
for the jboss-ejb3-ear
subproject, the packaging for the jboss-ejb3-ear
artifact is specified as ear
:
<artifactId>jboss-ejb3-ear</artifactId> <packaging>ear</packaging>
The pom.xml
file specifies dependency on the ejb and web modules:
<dependencies> <!-- Depend on the ejb module and war so that we can package them --> <dependency> <groupId>org.jboss.ejb3</groupId> <artifactId>jboss-ejb3-web</artifactId> <version>1.0.0</version> <type>war</type> </dependency> <dependency> <groupId>org.jboss.ejb3</groupId> <artifactId>jboss-ejb3-web</artifactId> <version>1.0.0</version> <type>war</type> </dependency> </dependencies>
The build
tag in the pom.xml
file specifies the configuration for the maven-ear-plugin
plugin with output directory as the deployments
directory in the WildFly 8.x standalone server. The EAR
file generated from the Maven project is deployed to the directory specified in the <outputDirectory/>
element. Specify the <outputDirectory/>
element as the C:wildfly-8.1.0.Finalstandalonedeployments
directory. The outputDirectory
might need to be modified based on the installation directory of WildFly 8.1. The EAR
, WAR
, and JAR
modules in the deployments directory get deployed to the WildFly automatically, if the server is running:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.8</version> <configuration> <!-- Tell Maven we are using Java EE 6 --> <version>6</version> <!-- Use Java EE ear libraries as needed. Java EE ear libraries are in easy way to package any libraries needed in the ear, and automatically have any modules (EJB-JARs and WARs) use them --> <defaultLibBundleDir>lib</defaultLibBundleDir> <fileNameMapping>no-version</fileNameMapping> <outputDirectory>C:wildfly-8.1.0.Finalstandalonedeployments</outputDirectory> </configuration> </plugin>