View | Details | Raw Unified | Return to bug 23396
Collapse All | Expand All

(-)WHATSNEW (-1 / +5 lines)
Lines 617-622 Link Here
617
  or end of a file. Discussion started at
617
  or end of a file. Discussion started at
618
  http://marc.theaimsgroup.com/?l=ant-user&m=106366791228585&w=2
618
  http://marc.theaimsgroup.com/?l=ant-user&m=106366791228585&w=2
619
619
620
* New task <ejbclientjar> added to enable generation of a ejb client jar
621
  file from a generic ejb jar file as input.
622
  This also fixes Bugzilla Report 21543.
623
620
Changes from Ant 1.5.3 to Ant 1.5.4
624
Changes from Ant 1.5.3 to Ant 1.5.4
621
===================================
625
===================================
622
626
Lines 2523-2526 Link Here
2523
2527
2524
* The packagelistloc attribute of <javadoc>'s <link> child will be
2528
* The packagelistloc attribute of <javadoc>'s <link> child will be
2525
  resolved as a file (i.e. it is either absolute or relative to
2529
  resolved as a file (i.e. it is either absolute or relative to
2526
  basedir).
2530
  basedir).
(-)build.xml (+19 lines)
Lines 248-253 Link Here
248
    </or>
248
    </or>
249
  </selector>
249
  </selector>
250
250
251
  <selector id="needs.ejb">
252
    <or>
253
        <filename name="${optional.package}/ejb/EjbClientJarTest*" />
254
        <filename name="${optional.package}/ejb/testejb/*" />
255
    </or>
256
  </selector>
257
251
  <selector id="needs.icontract">
258
  <selector id="needs.icontract">
252
    <filename name="${optional.package}/IContract*"/>
259
    <filename name="${optional.package}/IContract*"/>
253
  </selector>
260
  </selector>
Lines 473-478 Link Here
473
      </and>
480
      </and>
474
    </condition>
481
    </condition>
475
482
483
    <condition property="ejb.present">
484
      <and>
485
          <available classname="javax.ejb.SessionBean" classpathref="classpath"/>
486
          <available classname="javax.ejb.SessionContext" classpathref="classpath"/>
487
          <available classname="javax.ejb.EJBException" classpathref="classpath"/>
488
          <available classname="javax.ejb.CreateException" classpathref="classpath"/>
489
          <available classname="javax.ejb.EJBHome" classpathref="classpath"/>
490
          <available classname="javax.ejb.EJBObject" classpathref="classpath"/>
491
      </and>
492
    </condition>
493
476
    <condition property="some.regexp.support">
494
    <condition property="some.regexp.support">
477
      <or>
495
      <or>
478
        <isset property="jdk1.4+"/>
496
        <isset property="jdk1.4+"/>
Lines 624-629 Link Here
624
            <selector refid="needs.bsf" unless="bsf.present"/>
642
            <selector refid="needs.bsf" unless="bsf.present"/>
625
            <selector refid="needs.stylebook" unless="stylebook.present"/>
643
            <selector refid="needs.stylebook" unless="stylebook.present"/>
626
            <selector refid="needs.javamail" unless="javamail.complete"/>
644
            <selector refid="needs.javamail" unless="javamail.complete"/>
645
            <selector refid="needs.ejb" unless="ejb.present"/>
627
            <selector refid="needs.icontract" unless="icontract.present"/>
646
            <selector refid="needs.icontract" unless="icontract.present"/>
628
            <selector refid="needs.netrexx" unless="netrexx.present"/>
647
            <selector refid="needs.netrexx" unless="netrexx.present"/>
629
            <selector refid="needs.weblogic.ejbc" unless="ejb.ejbc.present"/>
648
            <selector refid="needs.weblogic.ejbc" unless="ejb.ejbc.present"/>
(-)docs/manual/install.html (-1 / +2 lines)
Lines 402-408 Link Here
402
    <td>bcel.jar</td>
402
    <td>bcel.jar</td>
403
    <td>classfileset data type,
403
    <td>classfileset data type,
404
        JavaClassHelper used by the ClassConstants filter reader and
404
        JavaClassHelper used by the ClassConstants filter reader and
405
        optionally used by ejbjar for dependency determination
405
        optionally used by ejbjar for dependency determination.<br/>
406
        Also used for dependency determination in <code>ejbclientjar</code>.
406
    </td>
407
    </td>
407
    <td><a href="http://jakarta.apache.org/bcel/" target="_top">http://jakarta.apache.org/bcel/</a></td>
408
    <td><a href="http://jakarta.apache.org/bcel/" target="_top">http://jakarta.apache.org/bcel/</a></td>
408
  </tr>
409
  </tr>
(-)docs/manual/OptionalTasks/ejb.html (+132 lines)
Lines 20-25 Link Here
20
  <li>Cyrille Morvan (<a href="mailto:cmorvan@ingenosya.com">cmorvan@ingenosya.com</a>)</li>
20
  <li>Cyrille Morvan (<a href="mailto:cmorvan@ingenosya.com">cmorvan@ingenosya.com</a>)</li>
21
  <li>Greg Nelson (<a href="mailto:gn@sun.com">gn@sun.com</a>)</li>
21
  <li>Greg Nelson (<a href="mailto:gn@sun.com">gn@sun.com</a>)</li>
22
  <li>Rob van Oostrum(<a href="mailto:rob@springwellfarms.ca">rob@springwellfarms.ca</a>)</li>
22
  <li>Rob van Oostrum(<a href="mailto:rob@springwellfarms.ca">rob@springwellfarms.ca</a>)</li>
23
  <li>Per Olesen (<a href="mailto:polesen@nordija.com">polesen@nordija.com</a>)</li>
23
</ul>
24
</ul>
24
25
25
<p>Version @VERSION@<br>
26
<p>Version @VERSION@<br>
Lines 71-76 Link Here
71
 <tr><td><a href="#ejbjar_jonas">jonas</a></td><td>JOnAS 2.4.x and 2.5</td></tr>
72
 <tr><td><a href="#ejbjar_jonas">jonas</a></td><td>JOnAS 2.4.x and 2.5</td></tr>
72
 <tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>Weblogic 5.1 to 7.0</td></tr>
73
 <tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>Weblogic 5.1 to 7.0</td></tr>
73
 <tr><td><a href="#ejbjar_websphere">websphere</a></td><td>IBM WebSphere 4.0</td></tr>
74
 <tr><td><a href="#ejbjar_websphere">websphere</a></td><td>IBM WebSphere 4.0</td></tr>
75
 <tr><td><a href="#ejbclientjar">ejbclientjar</a></td><td colspan="2">Generate a ejb client jar with client-view classes of ejbs</td></tr>
74
 <tr><td><a href="#wlrun">wlrun</a></td><td colspan="2">Weblogic 4.5.1 to 7.0</td></tr>
76
 <tr><td><a href="#wlrun">wlrun</a></td><td colspan="2">Weblogic 4.5.1 to 7.0</td></tr>
75
 <tr><td><a href="#wlstop">wlstop</a></td><td colspan="2">Weblogic 4.5.1 to 7.0</td></tr>
77
 <tr><td><a href="#wlstop">wlstop</a></td><td colspan="2">Weblogic 4.5.1 to 7.0</td></tr>
76
78
Lines 315-320 Link Here
315
</pre>
317
</pre>
316
318
317
<hr>
319
<hr>
320
<h2><a name="ejbclientjar">ejbclientjar</a></h2>
321
<h3><b>Description:</b></h3>
322
323
<p>The <code>ejbclientjar</code> task is used to generate ejb client jar files from ejbjar files.
324
With the input of a ejbjar file (which can be generated using <a href="#ejbjar">ejbjar</a>, this
325
task analyses the <code>ejb-jar.xml</code> deployment descriptor for classes in the beans client-view.
326
The client-view classes include remote and local interface, pk-class, home and local home and
327
any classes upon which these classes depend, including super-classes, classes used in parameters
328
and exceptions.</p>
329
330
<p><em>NOTE:</em>This task depends upon the optional
331
<a href="http://jakarta.apache.org/bcel">Byte Code Engineering Library for determining class dependencies</a>,
332
which must be in our ant lib. Please refer to <a href="../install.html#librarydependencies">for a description
333
of installing bcel with ant</a>.
334
335
<h3>Parameters:</h3>
336
337
<table border="1" cellpadding="2" cellspacing="0">
338
  <tr>
339
    <td valign="top"><b>Attribute</b></td>
340
    <td valign="top"><b>Description</b></td>
341
    <td align="center" valign="top"><b>Required</b></td>
342
  </tr>
343
  <tr>
344
    <td valign="top">srcdir</td>
345
    <td valign="top">
346
        The directory where the task looks for the ejbjar files to generate ejb client jar
347
        files from. The task is a <a href="../CoreTypes/fileset.html">FileSet</a>, so when
348
        selecting ejbjar files as input, this is the basedir which is searched.
349
    </td>
350
    <td valign="top" align="center">Yes</td>
351
  </tr>
352
  <tr>
353
    <td valign="top">destdir</td>
354
    <td valign="top">
355
        The directory where output ejb client jar files are written.
356
    </td>
357
    <td valign="top" align="center">Yes</td>
358
  </tr>
359
  <tr>
360
    <td valign="top">manifestclasspathprefix</td>
361
    <td valign="top">
362
        The value of this property is prefixed to any "Class-Path" attribute in the manifest in the
363
        output ejb client jar.
364
        In the process of determining dependencies, this task resolves where to find the files of the
365
        dependent classes (by using the nested "classpath" element). If it finds dependent classes
366
        in <code>.jar</code> or <code>.zip</code> files, these files are <em>not</em> added to the
367
        resulting ejb client jar. Instead, they are referenced using a Class-Path attribute in the manifest.
368
    </td>
369
    <td valign="top" align="center">No. Default is "lib".</td>
370
  </tr>
371
  <tr>
372
    <td valign="top">clientjarsuffix</td>
373
    <td valign="top">
374
        Determines the naming of output ejb client jar files. If this property is set to "-bar",
375
        and a input ejb jar file is named "foo.jar", the output ejb client jar is named "foo-bar.jar".
376
    </td>
377
    <td valign="top" align="center">No. Default is "-client".</td>
378
  </tr>
379
</table>
380
381
<h3>Nested Elements</h3>
382
383
<p>In addition to the standard nested elements of a <a href="../CoreTypes/fileset.html">FileSet</a>,
384
this task also supports nested <code>&lt;classpath&gt;</code> and <code>&lt;dtd&gt;</code> elements.</p>
385
386
<h4>classpath</h4>
387
388
<p>Is the standard <code>classpath</code> element, which is a <a href="../using.html#path">path-like structure</a>.
389
Use this element to give the classpath, that is used to find all client-view classes.</p>
390
391
<h4>dtd</h4>
392
393
<p>Specifies local dtd-locations used when parsing the <code>ejb-jar.xml</code> file. If this element is not
394
specified, the xml parser will try and validate the dtd using whatever the <code>DOCTYPE</code> of the
395
<code>ejb-jar.xml</code> specifies. Use this element if you would like to resolve dtds locally.</p>
396
397
<p>Parameters:</p>
398
<table border="1" cellpadding="2" cellspacing="0">
399
  <tr>
400
    <td valign="top"><b>Attribute</b></td>
401
    <td valign="top"><b>Description</b></td>
402
    <td align="center" valign="top"><b>Required</b></td>
403
  </tr>
404
  <tr>
405
    <td valign="top">publicId</td>
406
    <td valign="top">
407
       Whatever follows <code>PUBLIC</code> in the <code>DOCTYPE</code> of the <code>ejb-jar.xml</code>.
408
    </td>
409
    <td valign="top" align="center">Yes</td>
410
  </tr>
411
  <tr>
412
    <td valign="top">location</td>
413
    <td valign="top">
414
       Where to find the dtd locally.
415
    </td>
416
    <td valign="top" align="center">Yes</td>
417
  </tr>
418
</table>
419
420
<h3>Examples</h3>
421
422
<p>This example builds client-view ejb client jar files for all ".jar" files found in <code>${build.ejbs.dir}</code>.
423
The output files are written to <code>${build.clientejbs.dir}</code>, using a <code>-mysuffix</code> suffix
424
and a <code>mylib</code> prefix to the value of any Class-Path attribute in manifest.</p>
425
426
<p>Assuming the <code>${build.ejbs.dir}</code> directory contains the files <code>foo.jar</code>
427
and <code>bar.jar</code>, the output files in <code>${build.clientejbs.dir}</code> will be named
428
<code>foo-mysuffix.jar</code> and <code>bar-mysuffix.jar</code>. Also, if the client-view of bean
429
<code>foo.jar</code> depends upon classes found in <code>xml-apis.jar</code>
430
in the classpath, the manifest of the <code>foo-mysuffix.jar</code> will contain a <code>Class-Path</code>
431
attribute with the value <code>mylib/xml-apis.jar</code>.</p>
432
433
<pre>
434
    &lt;target name="build-clientejbs" depends="build-ejbs"&gt;
435
        &lt;ejbclientjar srcdir="${build.ejbs.dir}" destdir="${build.clientejbs.dir}" clientjarsuffix="-mysuffix" manifestclasspathprefix="mylib"&gt;
436
            &lt;classpath&gt;
437
                &lt;pathelement location="${build.classes.dir}" /&gt;
438
                &lt;pathelement location="${lib.dir}/xml-apis.jar" /&gt;
439
                &lt;pathelement location="${lib.dir}/xercesImpl.jar" /&gt;
440
            &lt;classpath /&gt;
441
            &lt;dtd publicid="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" location="${dtd.dir}/ejb-jar_2_0.dtd" /&gt;
442
            &lt;include name="*.jar" /&gt;
443
        &lt;/ejbclientjar&gt;
444
    &lt;/target&gt;
445
</pre>
446
447
<hr>
318
<h2><a name="wlrun">wlrun</a></h2>
448
<h2><a name="wlrun">wlrun</a></h2>
319
<h3><b>Description:</b></h3>
449
<h3><b>Description:</b></h3>
320
450
Lines 546-551 Link Here
546
  <li><a href="http://www.objectweb.org/jonas/">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li>
676
  <li><a href="http://www.objectweb.org/jonas/">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li>
547
</ul>
677
</ul>
548
678
679
<p>If you want to generate ejb client jars with client-view classes,
680
you can use the <a href="#ejbclientjar">ejbclientjar</a> task.</p>
549
681
550
<p>The task works as a directory scanning task, and performs an action for each
682
<p>The task works as a directory scanning task, and performs an action for each
551
deployment descriptor found. As such the includes and excludes should be set
683
deployment descriptor found. As such the includes and excludes should be set
(-)src/main/org/apache/tools/ant/taskdefs/defaults.properties (+1 lines)
Lines 97-102 Link Here
97
vsshistory=org.apache.tools.ant.taskdefs.optional.vss.MSVSSHISTORY
97
vsshistory=org.apache.tools.ant.taskdefs.optional.vss.MSVSSHISTORY
98
vsslabel=org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL
98
vsslabel=org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL
99
ejbjar=org.apache.tools.ant.taskdefs.optional.ejb.EjbJar
99
ejbjar=org.apache.tools.ant.taskdefs.optional.ejb.EjbJar
100
ejbclientjar=org.apache.tools.ant.taskdefs.optional.ejb.EjbClientJar
100
mparse=org.apache.tools.ant.taskdefs.optional.metamata.MParse
101
mparse=org.apache.tools.ant.taskdefs.optional.metamata.MParse
101
mmetrics=org.apache.tools.ant.taskdefs.optional.metamata.MMetrics
102
mmetrics=org.apache.tools.ant.taskdefs.optional.metamata.MMetrics
102
maudit=org.apache.tools.ant.taskdefs.optional.metamata.MAudit
103
maudit=org.apache.tools.ant.taskdefs.optional.metamata.MAudit

Return to bug 23396