An Example

 <target name="ejbdoclet" depends="prepare">

    <taskdef name="ejbdoclet" classname="xdoclet.ejb.EjbDocletTask" classpath="${xdoclet.jar.path};${lib.dir}/log4j.jar"/>

    <ejbdoclet sourcepath="${java.dir}"
                     destdir="${generated.java.dir}"
                     classpathref="project.class.path"
                     excludedtags="@version,@author"
                     ejbspec="2.0"
                     force="${xdoclet.force}">

        <fileset dir="${java.dir}">
            <include name="**/*Bean.java" />
        </fileset>

        <dataobject/>
        <remoteinterface/>
        <homeinterface/>
        <entitypk/>
        <entitycmp/>
        <deploymentdescriptor destdir="${build.dir}/ejb/META-INF"/>

        <jboss xmlencoding="UTF-8" typemapping="Hypersonic SQL" datasource="java:/DefaultDS"/>

    </ejbdoclet>

</target>
 

Bundled Tasks

<ejbdoclet/>

<webdoclet/>

Test

To run ejbdoclet against the test classes, run "build_test". This will generate the java files under "dist/test".

To test deployment on a specific server, add a specific parameter.

EJB Server Parameter
JBoss -D jboss.home=/usr/jboss
WebLogic -D weblogic.home=/usr/weblogic

You can test the deployment on multiple servers as well. Example: "build_test -Djboss.home /usr/jboss -Dweblogic.home /usr/weblogic"

Architecture : build_test.xml run ejbdoclet to generates the java classes, then compiles them, then create ejbdoclet.jar ready for deployment. Then all subprojects/test-xx.xml are run. Those EJB server specific test scripts will be run only if the specific parameter for the EJB server is specified.

Currently test-jboss.xml is simply set up to deploy the ejb by copying the ejbdoclet.jar to JBoss deploy directory.