Home arrow Web Authoring arrow Completing an EAR
WEB AUTHORING

Completing an EAR


In the second of two parts, we focus on deploying the EAR we built in the previous article. This article is excerpted from chapter three of the book JBoss at Work: A Practical Guide, written by Tom Marrs and Scott Davis (O'Reilly; ISBN: 0596007345). Copyright 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

Author Info:
By: O'Reilly Media
Rating: 5 stars5 stars5 stars5 stars5 stars / 6
July 10, 2007
TABLE OF CONTENTS:
  1. · Completing an EAR
  2. · Deploying the EAR
  3. · Adding a DAO
  4. · Using XDoclet

print this article
SEARCH DEVARTICLES

Completing an EAR
(Page 1 of 4 )

Ant EAR task

The final step in the process is to EAR up the results of the webapp and common builds. Just as there is a WAR task, Ant also provides us with an EAR task, as in Example 3-4.

Example 3-4.  master build.xml

<target name="ear" depends="compile">
        <ear destFile="${distribution.dir}/${ear.name}"
             appxml="${meta-inf.dir}/application.xml" >

            <!-- files to be included in
/ -->
            <fileset dir="${webapp.war.dir}" />
           
<fileset dir="${common.jar.dir}" />
        </ear>
    </target>

Notice that the EAR task requires us to pass it a well-formed application.xml file. Example 3-5 shows what a simple one looks like.

Example 3-5.  application.xml

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns=http://java.sun.com/xml/ns/j2ee 
           xmlns:xsi=http://www.w3.org/ 2001/XMLSchema-instance 
           xsi:schemaLocation="http:// java.sun.com/xml/ns/j2ee
               http://java.sun.com/
xml/ns/j2ee/application_1_4.xsd"
           version="1.4">
  <display-name>JBossAtWorkEAR</display-name>

  <module>
     
<web>
         <web-uri>webapp.war</web-uri>
         <context-root>jaw</context-root>
      </web>
  </module>

  <module>
      <java>common.jar</java>
  </module>

</application>

To verify the results of themasterbuild, change to the build/distribution directory and typejar tvf jaw.ear. You should see webapp.war, common.jar, and application.xml. We are now ready to deploy the EAR file.


blog comments powered by Disqus
WEB AUTHORING ARTICLES

- Top WordPress Plugins for Social Media
- How to Install WordPress on WAMPP
- More of the Best Wordpress Plugins for Comme...
- Top Wordpress Plugins to Fight Spam
- More of the top Drupal modules for SEO
- Top Drupal Modules for SEO
- More Top Wordpress Plugins for SEO
- Website Optimization Tips
- Backup and Restore a Drupal Website and Data...
- 5 Best Web Font Services
- Web Font Embedding Services
- Joomla Site Administration
- Create PHP Pages that Use WordPress Templates
- Top Joomla Extensions for Social Networking
- Drupal Modules for Site Navigation

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials