? src/etc/testcases/taskdefs/optional/ejb ? src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbClientJar.java ? src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJarHelper.java ? src/testcases/org/apache/tools/ant/taskdefs/optional/ejb Index: WHATSNEW =================================================================== RCS file: /home/cvspublic/ant/WHATSNEW,v retrieving revision 1.505 diff -u -r1.505 WHATSNEW --- WHATSNEW 23 Sep 2003 14:33:43 -0000 1.505 +++ WHATSNEW 1 Oct 2003 06:10:56 -0000 @@ -617,6 +617,10 @@ or end of a file. Discussion started at http://marc.theaimsgroup.com/?l=ant-user&m=106366791228585&w=2 +* New task added to enable generation of a ejb client jar + file from a generic ejb jar file as input. + This also fixes Bugzilla Report 21543. + Changes from Ant 1.5.3 to Ant 1.5.4 =================================== @@ -2523,4 +2527,4 @@ * The packagelistloc attribute of 's child will be resolved as a file (i.e. it is either absolute or relative to - basedir). \ No newline at end of file + basedir). Index: build.xml =================================================================== RCS file: /home/cvspublic/ant/build.xml,v retrieving revision 1.395 diff -u -r1.395 build.xml --- build.xml 25 Sep 2003 14:42:21 -0000 1.395 +++ build.xml 1 Oct 2003 06:10:58 -0000 @@ -248,6 +248,13 @@ + + + + + + + @@ -473,6 +480,17 @@ + + + + + + + + + + + @@ -624,6 +642,7 @@ + Index: docs/manual/install.html =================================================================== RCS file: /home/cvspublic/ant/docs/manual/install.html,v retrieving revision 1.59 diff -u -r1.59 install.html --- docs/manual/install.html 3 Sep 2003 07:58:04 -0000 1.59 +++ docs/manual/install.html 1 Oct 2003 06:10:59 -0000 @@ -402,7 +402,8 @@ bcel.jar classfileset data type, JavaClassHelper used by the ClassConstants filter reader and - optionally used by ejbjar for dependency determination + optionally used by ejbjar for dependency determination.
+ Also used for dependency determination in ejbclientjar. http://jakarta.apache.org/bcel/ Index: docs/manual/OptionalTasks/ejb.html =================================================================== RCS file: /home/cvspublic/ant/docs/manual/OptionalTasks/ejb.html,v retrieving revision 1.36 diff -u -r1.36 ejb.html --- docs/manual/OptionalTasks/ejb.html 17 Jul 2003 11:05:15 -0000 1.36 +++ docs/manual/OptionalTasks/ejb.html 1 Oct 2003 06:11:02 -0000 @@ -20,6 +20,7 @@
  • Cyrille Morvan (cmorvan@ingenosya.com)
  • Greg Nelson (gn@sun.com)
  • Rob van Oostrum(rob@springwellfarms.ca)
  • +
  • Per Olesen (polesen@nordija.com)
  • Version @VERSION@
    @@ -71,6 +72,7 @@ jonasJOnAS 2.4.x and 2.5 weblogicWeblogic 5.1 to 7.0 websphereIBM WebSphere 4.0 + ejbclientjarGenerate a ejb client jar with client-view classes of ejbs wlrunWeblogic 4.5.1 to 7.0 wlstopWeblogic 4.5.1 to 7.0 @@ -315,6 +317,147 @@


    +

    ejbclientjar

    +

    Description:

    + +

    The ejbclientjar task is used to generate ejb client jar files from ejbjar files. +With the input of a ejbjar file (which can be generated using ejbjar, this +task analyses the ejb-jar.xml deployment descriptor for classes in the beans client-view. +The client-view classes include remote and local interface, pk-class, home and local home and +any classes upon which these classes depend, including super-classes, classes used in parameters +and exceptions.

    + +

    NOTE:This task depends upon the optional +Byte Code Engineering Library for determining class dependencies, +which must be in our ant lib. Please refer to for a description +of installing bcel with ant. + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    srcdir + The directory where the task looks for the ejbjar files to generate ejb client jar + files from. The task is a FileSet, so when + selecting ejbjar files as input, this is the basedir which is searched. + Yes
    destdir + The directory where output ejb client jar files are written. + Yes
    manifestclasspathprefix + The value of this property is prefixed to any "Class-Path" attribute in the manifest in the + output ejb client jar. + In the process of determining dependencies, this task resolves where to find the files of the + dependent classes (by using the nested "classpath" element). If it finds dependent classes + in .jar or .zip files, these files are not added to the + resulting ejb client jar. Instead, they are referenced using a Class-Path attribute in the manifest. + No. Default is "lib".
    clientjarsuffix + Determines the naming of output ejb client jar files. If this property is set to "-bar", + and a input ejb jar file is named "foo.jar", the output ejb client jar is named "foo-bar.jar". + No. Default is "-client".
    + +

    Nested Elements

    + +

    In addition to the standard nested elements of a FileSet, +this task also supports nested <classpath> and <dtd> elements.

    + +

    classpath

    + +

    Is the standard classpath element, which is a path-like structure. +Use this element to give the classpath, that is used to find all client-view classes.

    + +

    support

    + +

    Makes it possible to include other files, which the automatic dependency analyzer does not find. +This could for instance be classes which are loaded on demand with Class.forName +or it could be resources. The support element is simply a FileSet, +and all files matched by the fileset is included in resulting client jar. More than one support element can be +specified.

    + +

    dtd

    + +

    Specifies local dtd-locations used when parsing the ejb-jar.xml file. If this element is not +specified, the xml parser will try and validate the dtd using whatever the DOCTYPE of the +ejb-jar.xml specifies. Use this element if you would like to resolve dtds locally.

    + +

    Parameters:

    + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    publicId + Whatever follows PUBLIC in the DOCTYPE of the ejb-jar.xml. + Yes
    location + Where to find the dtd locally. + Yes
    + +

    Examples

    + +

    This example builds client-view ejb client jar files for all ".jar" files found in ${build.ejbs.dir}. +The output files are written to ${build.clientejbs.dir}, using a -mysuffix suffix +and a mylib prefix to the value of any Class-Path attribute in manifest. +Any created output files will include property files found in support fileset with basedir +${build.classes.dir}.

    + +

    Assuming the ${build.ejbs.dir} directory contains the files foo.jar +and bar.jar, the output files in ${build.clientejbs.dir} will be named +foo-mysuffix.jar and bar-mysuffix.jar. Also, if the client-view of bean +foo.jar depends upon classes found in xml-apis.jar +in the classpath, the manifest of the foo-mysuffix.jar will contain a Class-Path +attribute with the value mylib/xml-apis.jar.

    + +
    +    <target name="build-clientejbs" depends="build-ejbs">
    +        <ejbclientjar srcdir="${build.ejbs.dir}" destdir="${build.clientejbs.dir}" clientjarsuffix="-mysuffix" manifestclasspathprefix="mylib">
    +            <classpath>
    +                <pathelement location="${build.classes.dir}" />
    +                <pathelement location="${lib.dir}/xml-apis.jar" />
    +                <pathelement location="${lib.dir}/xercesImpl.jar" />
    +            <classpath />
    +            <dtd publicid="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" location="${dtd.dir}/ejb-jar_2_0.dtd" />
    +            <include name="*.jar" />
    +            <support dir="${build.classes.dir}">
    +                <include name="**/*.properties" />
    +            <support />
    +        </ejbclientjar>
    +    </target>
    +
    + +

    wlrun

    Description:

    @@ -546,6 +689,8 @@
  • JOnAS 2.4.x and 2.5 Open Source EJB server
  • +

    If you want to generate ejb client jars with client-view classes, +you can use the ejbclientjar task.

    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 Index: src/main/org/apache/tools/ant/taskdefs/defaults.properties =================================================================== RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties,v retrieving revision 1.153 diff -u -r1.153 defaults.properties --- src/main/org/apache/tools/ant/taskdefs/defaults.properties 6 Sep 2003 07:09:59 -0000 1.153 +++ src/main/org/apache/tools/ant/taskdefs/defaults.properties 1 Oct 2003 06:11:04 -0000 @@ -97,6 +97,7 @@ vsshistory=org.apache.tools.ant.taskdefs.optional.vss.MSVSSHISTORY vsslabel=org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL ejbjar=org.apache.tools.ant.taskdefs.optional.ejb.EjbJar +ejbclientjar=org.apache.tools.ant.taskdefs.optional.ejb.EjbClientJar mparse=org.apache.tools.ant.taskdefs.optional.metamata.MParse mmetrics=org.apache.tools.ant.taskdefs.optional.metamata.MMetrics maudit=org.apache.tools.ant.taskdefs.optional.metamata.MAudit