You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Matthew Oatham <ma...@hotmail.com> on 2003/03/04 10:33:37 UTC
ANT best practices
Hi,
OK I've ordered Java Development with Ant book but until it arrives I wanted your opinion. Here's the question.
I create a base jar which will be used for deployment on different App servers so this base jar needs different deployment descriptors added to it depending on the target app server. In one build run a jar needs to be created for deployment on 4 different app servers therefore I seem to have a number of options:
For each app server run a jar task specifying the directories of class of files plus the specific deployment descriptor. Perhaps a bit of redundancy re-running a jar task all the time?
Create a generic jar in one task then in separate app server tasks copy the generic jar - rename it and add the required deployment descriptor.
Create a fileset then use this fileset in each app server specific task running a jar task to add this fileset plus deployment descriptor
Any other ideas / opinions / preferences?
Any feedback would be good.
Thanks
Matt.
Re: ANT best practices
Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Matthew Oatham" <ma...@hotmail.com>
To: <us...@ant.apache.org>
Sent: Tuesday, March 04, 2003 01:33
Subject: ANT best practices
Hi,
OK I've ordered Java Development with Ant book but until it arrives I wanted
your opinion. Here's the question.
>I create a base jar which will be used for deployment on different App
servers so this base jar needs different >deployment descriptors added to it
depending on the target app server. In one build run a jar needs to be
created >for deployment on 4 different app servers therefore I seem to have
a number of options:
>Create a fileset then use this fileset in each app server specific task
running a jar task to add this fileset plus
>deployment descriptor
I'd do this. Its easy to add new stuff to the fileset (=low maintenance) and
yet gives you customisation.
you could also use <antcall> to make the jar-for-an-app-server (dont you
hate that :) a reusable target.
Re: ANT best practices
Posted by Rafal Kedziorski <ra...@polonium.de>.
hi,
take a look on this:
http://www.urbancode.com/projects/ejbbenchmark/default.jsp
they are building the same application for:
- WebLogic 7.0
- JBoss 3.0
- Orion 1.5.x
Rafal
At 09:33 04.03.2003 +0000, Matthew Oatham wrote:
>Hi,
>
>OK I've ordered Java Development with Ant book but until it arrives I
>wanted your opinion. Here's the question.
>
>I create a base jar which will be used for deployment on different App
>servers so this base jar needs different deployment descriptors added to
>it depending on the target app server. In one build run a jar needs to be
>created for deployment on 4 different app servers therefore I seem to have
>a number of options:
>
>For each app server run a jar task specifying the directories of class of
>files plus the specific deployment descriptor. Perhaps a bit of redundancy
>re-running a jar task all the time?
>
>Create a generic jar in one task then in separate app server tasks copy
>the generic jar - rename it and add the required deployment descriptor.
>
>Create a fileset then use this fileset in each app server specific task
>running a jar task to add this fileset plus deployment descriptor
>
>Any other ideas / opinions / preferences?
>
>Any feedback would be good.
>
>Thanks
>
>Matt.
Re: ANT best practices
Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
On Tuesday, March 4, 2003, at 04:33 AM, Matthew Oatham wrote:
> Hi,
>
> OK I've ordered Java Development with Ant book
Thank you!
> I create a base jar which will be used for deployment on different App
> servers so this base jar needs different deployment descriptors added
> to it depending on the target app server. In one build run a jar needs
> to be created for deployment on 4 different app servers therefore I
> seem to have a number of options:
EJB JAR? So you need different vendor-specific deployment descriptors?
Or different ejb-jar.xml files?
If its different vendor-specific deployment descriptors, you can
typically let them all happily coexist in a single JAR file and there
is no need to build different ones for each vendor. In my current
project one EAR can deploy to both JRun and JBoss and it has both
vendor-specific pieces embedded in META-INF.
If you need different ejb-jar.xml files then, hmmm, something is wrong
with J2EE! :)) But if thats the case, why?
Notice I'm asking about the root issue rather than giving Ant specific
answers here. Ant can accommodate what you need, sure, but more
information is needed to determine the right next step.
Also, are you using XDoclet to build your deployment descriptors? If
not, I'd recommend you do so. It'll make life so much more pleasant.
> For each app server run a jar task specifying the directories of class
> of files plus the specific deployment descriptor. Perhaps a bit of
> redundancy re-running a jar task all the time?
Do you need 4 different JAR's in one build? Or will a build be
app-server specific?
Erik