ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Stockall <je...@cryptocard.com>
Subject Re: putting multiple ejb in a jar
Date Fri, 21 Feb 2003 18:20:13 GMT
On Friday, February 21, 2003, at 12:52 PM, Modha Kumar wrote:

> Thanks for the info, I will now focus on which beans to put together.
> Actually I am looking for a sample ejb-jar.xml jboss.xml build.xml
> in case of using multiple session beans.
> This will greatly help me in understanding the deployment files. There 
> are
> examples for these files all over the net which i used to learn in 
> case of
> single
> session bean and making a jar out of it, however i
> could not find one's that use multiple ejbs.

This is what I use to package 5 beans (3 session and 2 entity) in 1 jar.

This requires XDoclet to generate the deployment descriptors

To create the deployment descriptors:

<target name="build.deploy" depends="build.setup">
	<ejbdoclet
          destdir="${classes.dir}"
          excludedtags="@version,@author,@todo"
          ejbspec="1.1"
          force="true"
          verbose="true">
          <fileset dir="${src.dir}">
              <include name="com/company/FirstBean.java"/>
              <include name="com/company/SecondBean.java"/>
              <include name="com/company/ThirdBean.java"/>
              <include name="com/company/FourthBean.java"/>
              <include name="com/company/FifthBean.java"/>
          </fileset>

          <deploymentdescriptor
              destdir="${descriptors.dir}/${ant.project.name}"
              validatexml="true"
          />

          <jboss
             version="3.0"
             xmlencoding="UTF-8"
             destdir="${descriptors.dir}/${ant.project.name}"
             validatexml="true"
          />
     </ejbdoclet>
</target>

Then to create the jar:

<target name="build.ejb.jboss">
    <ejbjar srcdir="${classes.dep}"
         basejarname="${ant.project.name}"
         descriptordir="${descriptors.dir}/${ant.project.name}">

         <include name="**/ejb-jar.xml"/>
         <support dir="${classes.dir}"/>

         <jboss
             destdir="${build.lib.dir}"
             suffix="-JBoss.jar">
             <classpath location="${classes.dir}"/>
             <classpath refid="jboss.class.path"/>
         </jboss>
         <dtd    publicId="-//Sun Microsystems, Inc.//DTD Enterprise 
JavaBeans 1.1//EN"
             location="${dtd.dir}/ejb-jar_1_1.dtd"/>
         <dtd    publicId="-//JBoss//DTD JBOSS 3.0//EN"
             location="${dtd.dir}/jboss_3_0.dtd"/>
     </ejbjar>
</target>

Unless your beans are extremely simple or you enjoy pain you should use 
XDoclet to generate the at least the deployment descriptors, if not the 
home and remote interfaces as well.

Jesse Stockall - jesse@cryptocard.com
CRYPTOCard Corp.


Mime
View raw message