You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Allegar Robert <al...@bah.com> on 2000/06/30 21:24:19 UTC

EJB compilation

	Hey folks. Sorry if this has been touched on before, but are there any
plans to incorporate an EJB module? Currently I have created custom batch
files (NT) to do the job.

	If one is in development, I'd be happy to assist in the creation. If not, I
guess I'll write my own.

	I'm sure there are ways to coax ant to compile 30+ ejbs, but the issue is
that I want them in separate JAR files, not in the same one. So while I can
use ant to do almost everything, but it still requires some external calls
that I'd like to eliminate.

Regards,
Rob



RE: EJB compilation

Posted by Conor MacNeill <co...@m64.com>.
Paul,

> From: Paul Hodgetts [mailto:paulh@zzyzxtek.com]
>
> I'm new to the Ant/Jakarta world, so forgive me if this is a dumb
> questions, but where can I locate the WebLogic tasks?  I looked
> through the Jakarta nightly builds and archives, etc., but I didn't
> find any archive of additional tasks.
>

No its not a dumb question. I submitted a patch a fair while ago. It is not
presently in CVS. You can retrieve it from the mailing list manager. (Its
possible if a little difficult to use - read the message that came with your
subscription).

I will be adding this to CVS soon as a number of people seem to be using it
now.

I am just wondering where to put it under the optional hierarchy.

Conor


RE: EJB compilation

Posted by Paul Hodgetts <pa...@zzyzxtek.com>.
Conor MacNeill wrote:

 > There are a number of Application servers around which provide EJB
 > Containers. I have provided some EJB tasks for weblogic but I have not tried
 > to come up with a generic EJB task in the same way that Javac operates. Can
 > you give us more information on what your target environment is, etc?

I'm new to the Ant/Jakarta world, so forgive me if this is a dumb
questions, but where can I locate the WebLogic tasks?  I looked
through the Jakarta nightly builds and archives, etc., but I didn't
find any archive of additional tasks.

Thanks in advance for any pointers,
-Paul Hodgetts


RE: EJB compilation

Posted by Conor MacNeill <co...@m64.com>.
> From: M . Dietrich [mailto:mdt@diwa-gmbh.de]
>
> i've got one for wls. i can send it to everyone who is interested :)
>

By wls, do you mean weblogic server? I have built a couple of tasks for
weblogic 4.5 but I would be happy to incorporate any useful features you may
have developed into them.

I will add the weblogic tasks as optional tasks soon.

Conor


Re: EJB compilation

Posted by "M . Dietrich" <md...@diwa-gmbh.de>.
> > 	Hey folks. Sorry if this has been touched on before, but are
> > 	there any plans to incorporate an EJB module? Currently I have
> > 	created custom batch files (NT) to do the job.
> >
> > 	If one is in development, I'd be happy to assist in the
> > 	creation. If not, I guess I'll write my own.
> >
> > 	I'm sure there are ways to coax ant to compile 30+ ejbs, but
> > 	the issue is that I want them in separate JAR files, not in
> > 	the same one. So while I can use ant to do almost everything,
> > 	but it still requires some external calls that I'd like to
> > 	eliminate.
On Tue, Jul 04, 2000 at 02:22:56AM +1000, Conor MacNeill wrote:
> 
> There are a number of Application servers around which provide EJB
> Containers. I have provided some EJB tasks for weblogic but I have
> not tried to come up with a generic EJB task in the same way that
> Javac operates. Can you give us more information on what your target
> environment is, etc?

i've got one for wls. i can send it to everyone who is interested :)

RE: EJB compilation

Posted by Allegar Robert <al...@bah.com>.
Conor,
	What we currently have is a directory structure that facilitates both
source control and the twice daily builds we do. It's set up like this:

ProjectName
	|
	|-EJB
	|   |-source
	|   |	|-EJB1
	|   |	|-EJB2
	|   |	|-EJBn
	|   |
	|   |-bin
	|   |	|-EJB1
	|   |	|-EJB2
	|   |	|-EJBn
      |   |
      |   |-jar
	|     |-EJB1.jar
	|	|-EJB2.jar
	|	|-EJBn.jar
	|
	|-Packages
	|  |-source
	|  |-bin
	|  |-jar
	|
	|-JSP
	   |-source
  	   |-bin

	So what it amounts to is the three sections of the site -- pretty much all
three tiers -- have their own directory. The 'source' directories are for
our change control software, and the bin directories are for our publishing
software. I have ant set up to compile the 'packages' directory correctly
and place the completed packages jar file in the correct jar directory.

	The EJBs are a bit different, however, because both the deployment
descriptor and the container generated classes need to be put in the jar
file. Also, we want to have our EJBs in separate JAR files for component
reasons. So I wrote an NT batch file which enumerates the directory list
under the EJB directory, and calls the appropriate programs as necessary.
The names of the sub directories under the /EJB/source/ directory end up
being the names of the jar files. So here's the catch: I don't mind the
external call to the WL container to generate the EJB stubs as necessary.
However, the dynamic directory enumeration is really key.

	Currently, when we add an EJB, all we do is add a directory under the
/EJB/source/ directory and the next time the build script is run, it'll pick
it up automatically, create the appropriate bin directory, the appropriate
jar directory, and everything works fine. Perhaps there's a way to coax ant
to do this, but I haven't found out how yet.

	So here's what I'm looking for: Ant begins to run, and enumerates the list
of sub directories under a specific directory. A javac task is run for each
directory, then an external call is made to generate the container classes
for that javac call. After this, a jar task is run and everything is put in
the appropriate directory. It's pretty much a basic looping structure.
Something like:

	<target name="ejb" index="currDir" loopType="directory" dir="${ejbDir}">
		<javac srcdir="${currDir} ... />
		<exec ... />
		<jar ... />
	</target>

Or the looping structure could be a target based on other targets:

	<target name="ejb" index="currDir" loopType="target" dir="${ejbDir}"
targetLoop="ejbCompile,containerCompile,ejbJar" />

	<target name="ejbCompile>
		<javac srcdir="${currDir} ... />
	</target>

	<target name="containerCompile">
		<exec ... />
	</target>

	<target name="ejbJar">
		<jar ... />
	</target>

Dunno, just throwing out ideas. I've only done a cursory parse of the source
code, but my gut feeling is that while the enumeration and looping would be
easy, the plugging in of the index variable and the dynamic dependency on
other tasks might be the most challenging. As I said, I've only looked
briefly at the source.

	The other thing I'm currently using a batch file for is the pre-compilation
of my JSP files. While the initial delay of an uncompiled page is rather
small, we'd like to mitigate the delay as much as possible. I think I can
coax ant to do this one, because it's just a call to exec, however I'd
really like to do the looping structure (directory recursion) inside ant and
not inside the program that I'm calling. This will let me add my own syntax
checkers, etc and not force me to build/integrate directory recursion
functionality every time.

Thoughts?

Regards,
	Rob



-----Original Message-----
From: Conor MacNeill [mailto:conor@m64.com]
Sent: Monday, July 03, 2000 12:23 PM
To: ant-dev@jakarta.apache.org
Subject: RE: EJB compilation


Rob,

There are a number of Application servers around which provide EJB
Containers. I have provided some EJB tasks for weblogic but I have not tried
to come up with a generic EJB task in the same way that Javac operates. Can
you give us more information on what your target environment is, etc?

Conor

--
Conor MacNeill
Home: conor@m64.com
Work: conor@cortexebusiness.com.au
Web:  www.cortexebusiness.com.au





RE: EJB compilation

Posted by Conor MacNeill <co...@m64.com>.
Rob,

There are a number of Application servers around which provide EJB
Containers. I have provided some EJB tasks for weblogic but I have not tried
to come up with a generic EJB task in the same way that Javac operates. Can
you give us more information on what your target environment is, etc?

Conor

--
Conor MacNeill
Home: conor@m64.com
Work: conor@cortexebusiness.com.au
Web:  www.cortexebusiness.com.au


> -----Original Message-----
> From: Allegar Robert [mailto:allegar_robert@bah.com]
> Sent: Saturday, 1 July 2000 5:24
> To: ant-dev@jakarta.apache.org
> Subject: EJB compilation
>
>
> 	Hey folks. Sorry if this has been touched on before, but
> are there any
> plans to incorporate an EJB module? Currently I have created custom batch
> files (NT) to do the job.
>
> 	If one is in development, I'd be happy to assist in the
> creation. If not, I
> guess I'll write my own.
>
> 	I'm sure there are ways to coax ant to compile 30+ ejbs,
> but the issue is
> that I want them in separate JAR files, not in the same one. So
> while I can
> use ant to do almost everything, but it still requires some external calls
> that I'd like to eliminate.
>
> Regards,
> Rob
>
>
>