Configuring the Maven Ear Plugin for JBoss EAP 5

The Maven Ear plugin can generate application archives for deployment to JBoss Enterprise Application Platform 5.

Prerequisites:

  • WAR / EJB artifacts have been added as project dependencies.
  • Required libraries (Jar) have been added as project dependencies.

The default library directory, for an EAR, in JBoss EAP 5 is lib. If the defaultLibBundleDir configuration property is not set, the Maven Ear plugin will place the libraries in the root folder of the application archive.

The generate-application-xml goal generates the application.xml file, and the <jboss /> configuration generates the jboss-app.xml file.

The version property is set to ‘5’ for JBoss EAP 5. The following configuration example includes additional <jboss /> configuration properties: loader-repository and loader-repository-config. These properties are used to enable scoped class loading. See this article for additional information. See the Maven Ear plugin usage page for a list of supported <jboss /> configuration properties.

<build>
   <finalName>${project.artifactId}</finalName>
   <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-ear-plugin</artifactId>
         <version>2.6</version>
         <configuration>
            <defaultLibBundleDir>lib/</defaultLibBundleDir>
            <jboss>
               <version>5</version>
               <loader-repository>com.jboss.daytrader:archive=daytrader-app.ear</loader-repository>
               <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
            </jboss>
         </configuration>
         <goals>generate-application-xml</goals>
      </plugin>
   </plugins>
</build>

</post>

JBoss EAP 5 & Maven

  • JBoss Maven Java EE 5 Dependencies (link)
  • Configuring the Maven Ear Plugin for JBoss EAP 5
  • Integration Testing w/ Maven, Cargo, & JBoss EAP 5 (link)
  • Integration Testing w/ Maven, Arquillian, & JBoss EAP 5 (link)
  • JBoss EAP 5 Multi-Module Maven Project Structures (link)
  • JBoss Trading – Multi Module JBoss EAP 5 Project (link)
, ,

About Shane K Johnson

Technical Marketing Manager, Red Hat Inc.

View all posts by Shane K Johnson

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 115 other followers

%d bloggers like this: