You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Robert Nicholson <ro...@elastica.com> on 2001/05/12 22:01:21 UTC

Don't understand ejb-jar examples.

Why is the weblogic-ejb-jar.xml descriptor _excluded_?

<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>

So the idea is to always build a generic jar and use a nested element
to build a vendors server jar?

Using this example will the weblogic descriptor get included or not?

    <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>

If I'm not mistaken I'm assuming ejbjar is simply not vendor specific but
the
nested weblogic element knows to look for weblogic descriptors and include
them.

This would make sense as obviously once can then add vendor nested
extensions
to the ejbjar element.

Here's question. How do you specify multiple srcdir's?

If you look at the following Petstore rule you'll see they copy both util
and customer classes from the same level into the buildjar directory. It
would appear that I would
have to do the same in order to specify a common directory that contains
both sets
of classes. If I was able to specify mutiple sources I wouldn't have to do
to this.

<target name="customerejbjar" depends="init">
    <property name="customer.buildjardir"
value="${customer.home}/build/ejbjar"/>
    <mkdir dir="${customer.buildjardir}/META-INF"/>
    <copydir src="${customer.classbindir}" dest="${customer.buildjardir}" />
    <copydir src="${util.classbindir}" dest="${customer.buildjardir}" />
    <copyfile src="customer_ejb.xml"
dest="${customer.buildjardir}/META-INF/ejb-jar.xml" />
    <copyfile src="weblogic-ejb-jar.xml"
dest="${customer.buildjardir}/META-INF/weblogic-ejb-jar.xml" />
    <delete file="${customer.ejbjar}"/>
    <jar jarfile="${customer.ejbjar}" basedir="${customer.buildjardir}"/>
    <deltree dir="${customer.buildjardir}"/>
  </target>



Re: Don't understand ejb-jar examples.

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
From: "Robert Nicholson" <ro...@elastica.com>
> Why is the weblogic-ejb-jar.xml descriptor _excluded_?
>
> <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>

ejbjar processes only generic deployment descriptors. If you feed it a
weblogic deployment descriptor it will, ahh, barf.

>
> So the idea is to always build a generic jar and use a nested element
> to build a vendors server jar?

Yep. The nested element for weblogic is able to determine the weblogic
deployment descriptor based on the naming conventions for. That is why it
is not a problem to exclude the weblogic descriptor.

>
> Using this example will the weblogic descriptor get included or not?
>
>     <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>
>

should be OK.

> If I'm not mistaken I'm assuming ejbjar is simply not vendor specific but
> the
> nested weblogic element knows to look for weblogic descriptors and
include
> them.

Yes..

>
> This would make sense as obviously once can then add vendor nested
> extensions
> to the ejbjar element.
>
> Here's question. How do you specify multiple srcdir's?

Currently you can't.

>
> If you look at the following Petstore rule you'll see they copy both util
> and customer classes from the same level into the buildjar directory. It
> would appear that I would
> have to do the same in order to specify a common directory that contains
> both sets
> of classes. If I was able to specify mutiple sources I wouldn't have to
do
> to this.

True.

Conor