From 5b1dbf444c9b88e7803585fd069feaa072b30bfc Mon Sep 17 00:00:00 2001
From: Stefan Bodewig This task is designed to support building of arbitrary EJB1.1 jar files. Support is currently
provided for 'vanilla' EJB1.1 jar files - i.e. those containing only the user generated class
files and the standard deployment descriptor. Nested elements provide support for vendor
- specific deployment tools. Currently a nested element is provided for Weblogic 5.1 using the
- weblogic.ejbc tool.
This task assumes a particular naming convention for deployment descriptor files. For an
- Account bean, for example, the deployment descriptor would be named Account-ejb-jar.xml.
- This naming convention allows the task to distinguish deployment descriptors without relying on
- their positioning within a source tree. It is also used to derive the name of the .jar file
- which is generated. For the example this would be Account.jar. Vendor specific files
- are assumed to be named in a similar fashion. The deployment descriptor file which defines
- additional weblogic specific information for the above bean would be
- Account-weblogic-ejb-jar.xml.
+
This task supports two approaches to creating ejb jar files. The first approach assumes a particular
+ naming convention for deployment descriptor files. For an Account bean, for example, the deployment
+ descriptor would be named Account-ejb-jar.xml. This naming convention allows the task to
+ distinguish deployment descriptors without relying on their positioning within a source tree. It is
+ also used to derive the name of the .jar file which is generated. For the example this would be
+ Account.jar. Vendor specific files are assumed to be named in a similar fashion. The
+ deployment descriptor file which defines additional weblogic specific information for the above bean
+ would be Account-weblogic-ejb-jar.xml.
+ The second approach does not require a naming convention. This approach uses a specified a jar name
+ for the resultant ejb jar. If the jar name is present, then no naming convention is required. If the
+ jar name is not specified, then the default naming convention is expected for the deployment descriptor
+ files.
The task works as a directory scanning task, and performs an action for each deployment descriptor found. As such the includes and excludes should be set to ensure that all desired EJB1.1 @@ -205,13 +210,15 @@ or are out of date, the ejbc tool is run to generate new versions.
| Attribute | +Description | +Required | +
| destdir | +The base directory into which the generated weblogic ready jar files are deposited. + Jar files are deposited in directories correpsonding to their location within the + descriptordir namespace. | +Yes | +
| genericjarsuffix | +A generic jar is generated as an intermeditate step in build the weblogic deployment + jar. The suffix used to generate the generic jar file is not particularly important + unless it is desired to keep the generic jar file. It should not, however, be the same + as the suffix setting. | +No, defaults to '-generic.jar'. | +
| suffix | +String value appended to the basename of the deployment descriptor to create the filename of the + WebLogic EJB jar file. | +No, defaults to '.jar'. | +
| classpath | +The classpath to be used when running the weblogic ejbc tool. Note that this tool + typically requires the classes that make up the bean to be available on the classpath. + Currently, however, this will cause the ejbc tool to be run in a separate VM | +No | +
| keepgeneric | +This controls whether the generic file used as input to ejbc is retained. | +No, defaults to false | +
| toplinkdescriptor | +This specifes the name of the TOPLink deployment descriptor file contained in the + 'descriptordir' directory. | +Yes | +
| toplinkdtd | +This specifies the location of the TOPLink DTD file. This can be a file path or + a file URL. This attribute is not required, but using a local DTD is recommended. | +No, defaults to dtd file at www.objectpeople.com. | +
<ejbjar srcdir="${build.classes}"
descriptordir="${descriptor.dir}">
@@ -299,6 +372,40 @@ This example shows ejbjar being used to generate deployment jars for a Weblogic
<exclude name="**/*weblogic*.xml"/>
</ejbjar>
+
+This example shows ejbjar being used to generate a single deployment jar using a Weblogic EJB container. This example
+does not require the deployment descriptors to use the naming standard. This will create only one ejb jar file -
+'TheEJBJar.jar'.
+
+ <ejbjar srcdir="${build.classes}"
+ descriptordir="${descriptor.dir}"
+ basejarname="TheEJBJar">
+ <weblogic destdir="${deploymentjars.dir}"
+ classpath="${descriptorbuild.classpath}"/>
+ <include name="**/ejb-jar.xml"/>
+ <exclude name="**/weblogic*.xml"/>
+ </ejbjar>
+
+
+This example shows ejbjar being used to generate deployment jars for a TOPLink-enabled entity bean using a
+Weblogic EJB container. This example does not require the deployment descriptors to use the naming standard.
+This will create only one TOPLink-enabled ejb jar file - 'Address.jar'.
+
+ <ejbjar srcdir="${build.dir}"
+ destdir="${solant.ejb.dir}"
+ descriptordir="${descriptor.dir}"
+ basejarname="Address">
+ <weblogictoplink destdir="${solant.ejb.dir}"
+ classpath="${java.class.path}"
+ keepgeneric="false"
+ toplinkdescriptor="Address.xml"
+ toplinkdtd="file:///dtdfiles/toplink-cmp_2_5_1.dtd"
+ suffix=".jar"/>
+ <include name="**/ejb-jar.xml"/>
+ <exclude name="**/weblogic-ejb-jar.xml"/>
+ </ejbjar>
+
+