Packaging EAR file for JBoss 5.1 with Maven
The dependencies in a JBoss ear file go into the lib
folder at the root of the archive;
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.5</version>
<configuration>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<ejbModule>
<groupId>com.example.core</groupId>
<artifactId>core-business</artifactId>
</ejbModule>
<webModule>
<groupId>${project.parent.groupId}</groupId>
<artifactId>example-web</artifactId>
<uri>mydnb-web.war</uri>
</webModule>
</modules>
<jboss>
<version>5</version>
<loader-repository>${project.parent.groupId}:archive=example-ear.ear</loader-repository>
</jboss>
</configuration>
</plugin>
defaultLibBundleDir
ensures that the dependencies get copied into the lib
folder, whilst leaving the modules core-business
and example-web.war
at the root.