You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mohit Anchlia <mo...@gmail.com> on 2008/09/30 20:54:02 UTC
Packaging war
I have a war file that gets deployed in tomcat and jboss. I need to
include log4j.xml in WEB-INF/lib only in certain env. How can I
include this lib file selectively while pacakging war file
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Packaging war
Posted by Kamal Chandana Mettananda <lk...@gmail.com>.
Inside your jar command you may declare your criteria easily. Try ant
condition.
http://ant.apache.org/manual/CoreTasks/condition.html
First you may declare your criteria as a property, and check that inside a
condition.
---------------------------------------
Kamal Mettananda
http://lkamal.blogspot.com
On Wed, Oct 1, 2008 at 12:24 AM, Mohit Anchlia <mo...@gmail.com>wrote:
> I have a war file that gets deployed in tomcat and jboss. I need to
> include log4j.xml in WEB-INF/lib only in certain env. How can I
> include this lib file selectively while pacakging war file
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: Packaging war
Posted by supareno <re...@free.fr>.
hello,
you can something like that
<your_project>
|_ <folders>
|_ <resources>
|_ <config>
|_ <env_1>
| |_ config files for env_1
|_ <env_2>
|_ config files for env_2
and calling ant with the 'env' parameter
in your build file, you've defined a property 'env' and after, the build
process uses the
${env} property
for example, you can define a log4j file for each env and put a log4j
file in the different 'env' folders in the config folder
in your build.xml, the property of the log4j file will be:
<property name="log4j.file" value="resources/config/${env}/log4j.xml">
etc...
hope this help!
supareno
> But it looks like I can't put it under if/else. Something like:
>
> <if>
> <${env} = "x">
> <then>
> <fileset includes="*.jar" dir="${WEB_INF}/lib" />
>
> On Wed, Oct 1, 2008 at 8:02 PM, Kamal Chandana Mettananda
> <lk...@gmail.com> wrote:
>
>> Yes you can. Following is just an example of using .jar files from a given
>> directory.
>>
>> <fileset includes="*.jar" dir="${WEB_INF}/lib" />
>>
>>
>>
>>
>> ---------------------------------------
>>
>> Kamal Mettananda
>> http://lkamal.blogspot.com
>>
>>
>> On Wed, Oct 1, 2008 at 8:31 PM, Mohit Anchlia <mo...@gmail.com>wrote:
>>
>>
>>> Can I also use patterns inside of fileset?
>>>
>>> On Tue, Sep 30, 2008 at 10:20 PM, <Ja...@rzf.fin-nrw.de> wrote:
>>>
>>>> With conditional pattern ...
>>>>
>>>> <war...>
>>>> <fileset ...>
>>>> <include name="log4j.xml" if="anAntPatternIsSet"/>
>>>>
>>>>
>>>> Jan
>>>>
>>>>
>>>>> -----Ursprüngliche Nachricht-----
>>>>> Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
>>>>> Gesendet: Dienstag, 30. September 2008 20:54
>>>>> An: user@ant.apache.org
>>>>> Betreff: Packaging war
>>>>>
>>>>> I have a war file that gets deployed in tomcat and jboss. I need to
>>>>> include log4j.xml in WEB-INF/lib only in certain env. How can I
>>>>> include this lib file selectively while pacakging war file
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>>> For additional commands, e-mail: user-help@ant.apache.org
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>> For additional commands, e-mail: user-help@ant.apache.org
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Packaging war
Posted by Mohit Anchlia <mo...@gmail.com>.
But it looks like I can't put it under if/else. Something like:
<if>
<${env} = "x">
<then>
<fileset includes="*.jar" dir="${WEB_INF}/lib" />
On Wed, Oct 1, 2008 at 8:02 PM, Kamal Chandana Mettananda
<lk...@gmail.com> wrote:
> Yes you can. Following is just an example of using .jar files from a given
> directory.
>
> <fileset includes="*.jar" dir="${WEB_INF}/lib" />
>
>
>
>
> ---------------------------------------
>
> Kamal Mettananda
> http://lkamal.blogspot.com
>
>
> On Wed, Oct 1, 2008 at 8:31 PM, Mohit Anchlia <mo...@gmail.com>wrote:
>
>> Can I also use patterns inside of fileset?
>>
>> On Tue, Sep 30, 2008 at 10:20 PM, <Ja...@rzf.fin-nrw.de> wrote:
>> > With conditional pattern ...
>> >
>> > <war...>
>> > <fileset ...>
>> > <include name="log4j.xml" if="anAntPatternIsSet"/>
>> >
>> >
>> > Jan
>> >
>> >>-----Ursprüngliche Nachricht-----
>> >>Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
>> >>Gesendet: Dienstag, 30. September 2008 20:54
>> >>An: user@ant.apache.org
>> >>Betreff: Packaging war
>> >>
>> >>I have a war file that gets deployed in tomcat and jboss. I need to
>> >>include log4j.xml in WEB-INF/lib only in certain env. How can I
>> >>include this lib file selectively while pacakging war file
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> >>For additional commands, e-mail: user-help@ant.apache.org
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> > For additional commands, e-mail: user-help@ant.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Packaging war
Posted by Kamal Chandana Mettananda <lk...@gmail.com>.
Yes you can. Following is just an example of using .jar files from a given
directory.
<fileset includes="*.jar" dir="${WEB_INF}/lib" />
---------------------------------------
Kamal Mettananda
http://lkamal.blogspot.com
On Wed, Oct 1, 2008 at 8:31 PM, Mohit Anchlia <mo...@gmail.com>wrote:
> Can I also use patterns inside of fileset?
>
> On Tue, Sep 30, 2008 at 10:20 PM, <Ja...@rzf.fin-nrw.de> wrote:
> > With conditional pattern ...
> >
> > <war...>
> > <fileset ...>
> > <include name="log4j.xml" if="anAntPatternIsSet"/>
> >
> >
> > Jan
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
> >>Gesendet: Dienstag, 30. September 2008 20:54
> >>An: user@ant.apache.org
> >>Betreff: Packaging war
> >>
> >>I have a war file that gets deployed in tomcat and jboss. I need to
> >>include log4j.xml in WEB-INF/lib only in certain env. How can I
> >>include this lib file selectively while pacakging war file
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >>For additional commands, e-mail: user-help@ant.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: Packaging war
Posted by Mohit Anchlia <mo...@gmail.com>.
Can I also use patterns inside of fileset?
On Tue, Sep 30, 2008 at 10:20 PM, <Ja...@rzf.fin-nrw.de> wrote:
> With conditional pattern ...
>
> <war...>
> <fileset ...>
> <include name="log4j.xml" if="anAntPatternIsSet"/>
>
>
> Jan
>
>>-----Ursprüngliche Nachricht-----
>>Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
>>Gesendet: Dienstag, 30. September 2008 20:54
>>An: user@ant.apache.org
>>Betreff: Packaging war
>>
>>I have a war file that gets deployed in tomcat and jboss. I need to
>>include log4j.xml in WEB-INF/lib only in certain env. How can I
>>include this lib file selectively while pacakging war file
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: Packaging war
Posted by Ja...@rzf.fin-nrw.de.
With conditional pattern ...
<war...>
<fileset ...>
<include name="log4j.xml" if="anAntPatternIsSet"/>
Jan
>-----Ursprüngliche Nachricht-----
>Von: Mohit Anchlia [mailto:mohitanchlia@gmail.com]
>Gesendet: Dienstag, 30. September 2008 20:54
>An: user@ant.apache.org
>Betreff: Packaging war
>
>I have a war file that gets deployed in tomcat and jboss. I need to
>include log4j.xml in WEB-INF/lib only in certain env. How can I
>include this lib file selectively while pacakging war file
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org