> -----Original Message-----
> From: Chekutty, Kiran [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 15, 2002 7:26 AM
> To: Ant Users List
> Subject: How to avoid naming conventions in <ejbjar> task
> 
> 
> Hi Rescuers
> Can I use just ejb-jar.xml & weblogic-ejb-jar.xml rather than 
> having a ejb-name in front of both the deployment 
> descriptors. This is because I am building a ant script for a 
> big project thats developed long before. I need to rename all 
> the deployment descriptors.And I want to avoid doing so. 
> 
> Thanks in advance 
> 
> 
> Kiran Chekutty
> Petrotechnics Ltd.
> 


Use the naming=ejb-name attribute. It will look in the deployment descriptor and use 
what's in the <ejb-name> as the name of the resulting jar file. Each of our EJBs is in 
it's own directory so we have the same issue. Here's our task:

    <ejbjar descriptordir="${ejb.src.dir}"
            srcdir="${build.dir}"
            destdir="${build.dir}"
            dependency="full"
            naming="ejb-name"
            flatdestdir="no">
      <include name="**/ejb/**/ejb-jar.xml"/>
      <exclude name="**/ejb/**/*weblogic*.xml"/>
      <!--
        The weblogic task will force the ejbjar task to include any
        WebLogic specific deployment descriptors in the EJB Jar file
        and then compile the jar with WebLogic's ejbc compiler.
      -->
      <weblogic destdir="${build.dir}"
                newCMP="yes"
                ejbcclass="weblogic.ejbc">
        <wlclasspath>
          <fileset dir="${weblogic.home}/lib">
            <include name="**/*.jar"/>
          </fileset>
          <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
          </fileset>
          <pathelement path="${build.dir}"/>
        </wlclasspath>
      </weblogic>
      <!--
        Define local locations for the DTD's.
      -->
      <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
           location="${build.config.dir}/ejb-jar_1_1.dtd"/>
      <dtd publicId="-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"
           location="${build.config.dir}/weblogic-ejb-jar.dtd"/>
      <dtd publicId="-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS 
Persistence//EN"
           location="${build.config.dir}/weblogic-rdbms-persistence.dtd"/>
    </ejbjar>

This works very well for us. We end up with all our EJBs in a their own JAR compiled, 
assembled, and ready to deploy.

/mike

Reply via email to