You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Roman Sokolyuk <ro...@gmail.com> on 2010/02/12 01:17:40 UTC
Copying external file into WAR
Hi,
Could someone please tell me how I can accomplish the following?
I want to build a war file. Additionally there is a configuration file that
is found outside of the WEB-INF directory, but when that WEB-INF dir is
packaged into the war I want to place that config file in WEB-INf in the war
- without having to copy it into the actual WEB-INF before making the WAR
file.
Thanks.
Re: Copying external file into WAR
Posted by Roman Sokolyuk <ro...@gmail.com>.
You are right!! This is the solution
On Mon, Feb 15, 2010 at 6:39 PM, Antoine Levy Lambert <an...@gmx.de>wrote:
> Is it not possible to have several webinf tags ?
>
> Antoine
>
>
> Roman Sokolyuk wrote:
>
>> That's the problem - the *webinf *tag allows you to specify a source
>> folder
>> to become the *webinf *folder in the war - but it assumes everything is
>> already in it. So copying seems like the only option.
>>
>> On Fri, Feb 12, 2010 at 12:36 PM, Moore, Kent <Kent.Moore@fisglobal.com
>> >wrote:
>>
>>
>>
>>> No need to copy stuff around when creating archives - pick it up from
>>> wherever it is.
>>>
>>>
>>> To include stuff in the WEB-INF folder, see the webinf section of the
>>> war man page --> http://ant.apache.org/manual/CoreTasks/war.html.
>>>
>>>
>>> End up with something like this:
>>>
>>> <war destfile="${pub.dir}/${release.war}"
>>> webxml="${websrc.dir}/WEB-INF/web.xml" duplicate="fail">
>>> <classes dir="${classes.prod.dir}">
>>> <include name="**/*.class"/>
>>> </classes>
>>> <fileset dir="${websrc.dir}">
>>> <exclude name="**/*.xml"/>
>>> </fileset>
>>> <fileset dir="${genSrc.dir}"/>
>>> <lib dir="${lib.dir}">
>>> <patternset refid="dependent.libraries"/>
>>> <patternset refid="other.libraries"/>
>>> </lib>
>>> <webinf dir="${websrc.dir}">
>>> <include name="struts-config.xml"/>
>>> <include name="cachespec.xml"/>
>>> </webinf>
>>> </war>
>>>
>>>
>>> -----Original Message-----
>>> From: Rez P [mailto:pons32@hotmail.com]
>>> Sent: Friday, February 12, 2010 12:23 PM
>>> To: Ant
>>> Subject: RE: Copying external file into WAR
>>>
>>>
>>> Then maybe you could accomplish it by doing a copy command. Copy the
>>> file from its source to where you stage the war file, either before you
>>> execute the war task or within the war task. After I usually run my
>>> clean target, I do all my staging in the init target even if the
>>> compiled classes paths don't exist yet! I create the directories and
>>> copy my files in advance in the init target and when the javac task
>>> runs, it has no problem or issues with the folders already pre-existing;
>>> it would be the same as an incremental build or not running the clean
>>> target. I hope this helps.
>>>
>>>
>>>
>>>
>>>> Date: Fri, 12 Feb 2010 07:37:08 -0500
>>>> Subject: Re: Copying external file into WAR
>>>> From: romsok.tech@gmail.com
>>>> To: user@ant.apache.org
>>>>
>>>> That would work for web.xml - but I would like to copy another,
>>>>
>>>>
>>> unrelated
>>>
>>>
>>>> properties file from an external dir to the WAR's WEB-INF.
>>>> I looked at the examples in the manual, but maybe I am missing
>>>>
>>>>
>>> something...
>>>
>>>
>>>> On Thu, Feb 11, 2010 at 7:56 PM, Rez P <po...@hotmail.com> wrote:
>>>>
>>>>
>>>>
>>>>> Check out the Ant manual, it has some examples. In the excerpt
>>>>>
>>>>>
>>>> below, all
>>>
>>>
>>>> you have to do in the war task is to change the location or path of
>>>>>
>>>>>
>>>> the
>>>
>>>
>>>> webxml attribute. If the web.xml is outside of your project in a
>>>>>
>>>>>
>>>> higher
>>>
>>>
>>>> heirachy than your project, all you have to do is to type the
>>>>>
>>>>>
>>>> absolute path,
>>>
>>>
>>>> starting at the root of the system and tell it where the web.xml is.
>>>>>
>>>>>
>>>>>
>>>>> e.g. /my/other/project/web.xml
>>>>>
>>>>>
>>>>>
>>>>> http://ant.apache.org/manual/index.html
>>>>>
>>>>>
>>>>>
>>>>> <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
>>>>> <fileset dir="src/html/myapp"/>
>>>>> <fileset dir="src/jsp/myapp"/>
>>>>> <lib dir="thirdparty/libs">
>>>>> <exclude name="jdbc1.jar"/>
>>>>> </lib>
>>>>> <classes dir="build/main"/>
>>>>> <zipfileset dir="src/graphics/images/gifs"
>>>>> prefix="images"/>
>>>>> </war>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Date: Thu, 11 Feb 2010 19:17:40 -0500
>>>>>> Subject: Copying external file into WAR
>>>>>> From: romsok.tech@gmail.com
>>>>>> To: user@ant.apache.org
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Could someone please tell me how I can accomplish the following?
>>>>>>
>>>>>> I want to build a war file. Additionally there is a configuration
>>>>>>
>>>>>>
>>>>> file
>>>
>>>
>>>> that
>>>>>
>>>>>
>>>>>> is found outside of the WEB-INF directory, but when that WEB-INF
>>>>>>
>>>>>>
>>>>> dir is
>>>
>>>
>>>> packaged into the war I want to place that config file in WEB-INf
>>>>>>
>>>>>>
>>>>> in the
>>>
>>>
>>>> war
>>>>>
>>>>>
>>>>>> - without having to copy it into the actual WEB-INF before making
>>>>>>
>>>>>>
>>>>> the WAR
>>>
>>>
>>>> file.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>> _________________________________________________________________
>>>>> Hotmail: Free, trusted and rich email service.
>>>>> http://clk.atdmt.com/GBL/go/201469228/direct/01/
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: Copying external file into WAR
Posted by Antoine Levy Lambert <an...@gmx.de>.
Is it not possible to have several webinf tags ?
Antoine
Roman Sokolyuk wrote:
> That's the problem - the *webinf *tag allows you to specify a source folder
> to become the *webinf *folder in the war - but it assumes everything is
> already in it. So copying seems like the only option.
>
> On Fri, Feb 12, 2010 at 12:36 PM, Moore, Kent <Ke...@fisglobal.com>wrote:
>
>
>> No need to copy stuff around when creating archives - pick it up from
>> wherever it is.
>>
>>
>> To include stuff in the WEB-INF folder, see the webinf section of the
>> war man page --> http://ant.apache.org/manual/CoreTasks/war.html.
>>
>>
>> End up with something like this:
>>
>> <war destfile="${pub.dir}/${release.war}"
>> webxml="${websrc.dir}/WEB-INF/web.xml" duplicate="fail">
>> <classes dir="${classes.prod.dir}">
>> <include name="**/*.class"/>
>> </classes>
>> <fileset dir="${websrc.dir}">
>> <exclude name="**/*.xml"/>
>> </fileset>
>> <fileset dir="${genSrc.dir}"/>
>> <lib dir="${lib.dir}">
>> <patternset refid="dependent.libraries"/>
>> <patternset refid="other.libraries"/>
>> </lib>
>> <webinf dir="${websrc.dir}">
>> <include name="struts-config.xml"/>
>> <include name="cachespec.xml"/>
>> </webinf>
>> </war>
>>
>>
>> -----Original Message-----
>> From: Rez P [mailto:pons32@hotmail.com]
>> Sent: Friday, February 12, 2010 12:23 PM
>> To: Ant
>> Subject: RE: Copying external file into WAR
>>
>>
>> Then maybe you could accomplish it by doing a copy command. Copy the
>> file from its source to where you stage the war file, either before you
>> execute the war task or within the war task. After I usually run my
>> clean target, I do all my staging in the init target even if the
>> compiled classes paths don't exist yet! I create the directories and
>> copy my files in advance in the init target and when the javac task
>> runs, it has no problem or issues with the folders already pre-existing;
>> it would be the same as an incremental build or not running the clean
>> target. I hope this helps.
>>
>>
>>
>>> Date: Fri, 12 Feb 2010 07:37:08 -0500
>>> Subject: Re: Copying external file into WAR
>>> From: romsok.tech@gmail.com
>>> To: user@ant.apache.org
>>>
>>> That would work for web.xml - but I would like to copy another,
>>>
>> unrelated
>>
>>> properties file from an external dir to the WAR's WEB-INF.
>>> I looked at the examples in the manual, but maybe I am missing
>>>
>> something...
>>
>>> On Thu, Feb 11, 2010 at 7:56 PM, Rez P <po...@hotmail.com> wrote:
>>>
>>>
>>>> Check out the Ant manual, it has some examples. In the excerpt
>>>>
>> below, all
>>
>>>> you have to do in the war task is to change the location or path of
>>>>
>> the
>>
>>>> webxml attribute. If the web.xml is outside of your project in a
>>>>
>> higher
>>
>>>> heirachy than your project, all you have to do is to type the
>>>>
>> absolute path,
>>
>>>> starting at the root of the system and tell it where the web.xml is.
>>>>
>>>>
>>>>
>>>> e.g. /my/other/project/web.xml
>>>>
>>>>
>>>>
>>>> http://ant.apache.org/manual/index.html
>>>>
>>>>
>>>>
>>>> <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
>>>> <fileset dir="src/html/myapp"/>
>>>> <fileset dir="src/jsp/myapp"/>
>>>> <lib dir="thirdparty/libs">
>>>> <exclude name="jdbc1.jar"/>
>>>> </lib>
>>>> <classes dir="build/main"/>
>>>> <zipfileset dir="src/graphics/images/gifs"
>>>> prefix="images"/>
>>>> </war>
>>>>
>>>>
>>>>
>>>>> Date: Thu, 11 Feb 2010 19:17:40 -0500
>>>>> Subject: Copying external file into WAR
>>>>> From: romsok.tech@gmail.com
>>>>> To: user@ant.apache.org
>>>>>
>>>>> Hi,
>>>>>
>>>>> Could someone please tell me how I can accomplish the following?
>>>>>
>>>>> I want to build a war file. Additionally there is a configuration
>>>>>
>> file
>>
>>>> that
>>>>
>>>>> is found outside of the WEB-INF directory, but when that WEB-INF
>>>>>
>> dir is
>>
>>>>> packaged into the war I want to place that config file in WEB-INf
>>>>>
>> in the
>>
>>>> war
>>>>
>>>>> - without having to copy it into the actual WEB-INF before making
>>>>>
>> the WAR
>>
>>>>> file.
>>>>>
>>>>> Thanks.
>>>>>
>>>> _________________________________________________________________
>>>> Hotmail: Free, trusted and rich email service.
>>>> http://clk.atdmt.com/GBL/go/201469228/direct/01/
>>>>
>>>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Copying external file into WAR
Posted by Roman Sokolyuk <ro...@gmail.com>.
That's the problem - the *webinf *tag allows you to specify a source folder
to become the *webinf *folder in the war - but it assumes everything is
already in it. So copying seems like the only option.
On Fri, Feb 12, 2010 at 12:36 PM, Moore, Kent <Ke...@fisglobal.com>wrote:
> No need to copy stuff around when creating archives - pick it up from
> wherever it is.
>
>
> To include stuff in the WEB-INF folder, see the webinf section of the
> war man page --> http://ant.apache.org/manual/CoreTasks/war.html.
>
>
> End up with something like this:
>
> <war destfile="${pub.dir}/${release.war}"
> webxml="${websrc.dir}/WEB-INF/web.xml" duplicate="fail">
> <classes dir="${classes.prod.dir}">
> <include name="**/*.class"/>
> </classes>
> <fileset dir="${websrc.dir}">
> <exclude name="**/*.xml"/>
> </fileset>
> <fileset dir="${genSrc.dir}"/>
> <lib dir="${lib.dir}">
> <patternset refid="dependent.libraries"/>
> <patternset refid="other.libraries"/>
> </lib>
> <webinf dir="${websrc.dir}">
> <include name="struts-config.xml"/>
> <include name="cachespec.xml"/>
> </webinf>
> </war>
>
>
> -----Original Message-----
> From: Rez P [mailto:pons32@hotmail.com]
> Sent: Friday, February 12, 2010 12:23 PM
> To: Ant
> Subject: RE: Copying external file into WAR
>
>
> Then maybe you could accomplish it by doing a copy command. Copy the
> file from its source to where you stage the war file, either before you
> execute the war task or within the war task. After I usually run my
> clean target, I do all my staging in the init target even if the
> compiled classes paths don't exist yet! I create the directories and
> copy my files in advance in the init target and when the javac task
> runs, it has no problem or issues with the folders already pre-existing;
> it would be the same as an incremental build or not running the clean
> target. I hope this helps.
>
>
> > Date: Fri, 12 Feb 2010 07:37:08 -0500
> > Subject: Re: Copying external file into WAR
> > From: romsok.tech@gmail.com
> > To: user@ant.apache.org
> >
> > That would work for web.xml - but I would like to copy another,
> unrelated
> > properties file from an external dir to the WAR's WEB-INF.
> > I looked at the examples in the manual, but maybe I am missing
> something...
> >
> > On Thu, Feb 11, 2010 at 7:56 PM, Rez P <po...@hotmail.com> wrote:
> >
> > >
> > > Check out the Ant manual, it has some examples. In the excerpt
> below, all
> > > you have to do in the war task is to change the location or path of
> the
> > > webxml attribute. If the web.xml is outside of your project in a
> higher
> > > heirachy than your project, all you have to do is to type the
> absolute path,
> > > starting at the root of the system and tell it where the web.xml is.
> > >
> > >
> > >
> > > e.g. /my/other/project/web.xml
> > >
> > >
> > >
> > > http://ant.apache.org/manual/index.html
> > >
> > >
> > >
> > > <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
> > > <fileset dir="src/html/myapp"/>
> > > <fileset dir="src/jsp/myapp"/>
> > > <lib dir="thirdparty/libs">
> > > <exclude name="jdbc1.jar"/>
> > > </lib>
> > > <classes dir="build/main"/>
> > > <zipfileset dir="src/graphics/images/gifs"
> > > prefix="images"/>
> > > </war>
> > >
> > >
> > > > Date: Thu, 11 Feb 2010 19:17:40 -0500
> > > > Subject: Copying external file into WAR
> > > > From: romsok.tech@gmail.com
> > > > To: user@ant.apache.org
> > > >
> > > > Hi,
> > > >
> > > > Could someone please tell me how I can accomplish the following?
> > > >
> > > > I want to build a war file. Additionally there is a configuration
> file
> > > that
> > > > is found outside of the WEB-INF directory, but when that WEB-INF
> dir is
> > > > packaged into the war I want to place that config file in WEB-INf
> in the
> > > war
> > > > - without having to copy it into the actual WEB-INF before making
> the WAR
> > > > file.
> > > >
> > > > Thanks.
> > >
> > > _________________________________________________________________
> > > Hotmail: Free, trusted and rich email service.
> > > http://clk.atdmt.com/GBL/go/201469228/direct/01/
> > >
>
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> http://clk.atdmt.com/GBL/go/201469230/direct/01/
>
> _____________
>
> The information contained in this message is proprietary and/or
> confidential. If you are not the intended recipient, please: (i) delete the
> message and all copies; (ii) do not disclose, distribute or use the message
> in any manner; and (iii) notify the sender immediately. In addition, please
> be aware that any message addressed to our domain is subject to archiving
> and review by persons other than the intended recipient. Thank you.
> _____________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
RE: Copying external file into WAR
Posted by "Moore, Kent" <Ke...@fisglobal.com>.
No need to copy stuff around when creating archives - pick it up from
wherever it is.
To include stuff in the WEB-INF folder, see the webinf section of the
war man page --> http://ant.apache.org/manual/CoreTasks/war.html.
End up with something like this:
<war destfile="${pub.dir}/${release.war}"
webxml="${websrc.dir}/WEB-INF/web.xml" duplicate="fail">
<classes dir="${classes.prod.dir}">
<include name="**/*.class"/>
</classes>
<fileset dir="${websrc.dir}">
<exclude name="**/*.xml"/>
</fileset>
<fileset dir="${genSrc.dir}"/>
<lib dir="${lib.dir}">
<patternset refid="dependent.libraries"/>
<patternset refid="other.libraries"/>
</lib>
<webinf dir="${websrc.dir}">
<include name="struts-config.xml"/>
<include name="cachespec.xml"/>
</webinf>
</war>
-----Original Message-----
From: Rez P [mailto:pons32@hotmail.com]
Sent: Friday, February 12, 2010 12:23 PM
To: Ant
Subject: RE: Copying external file into WAR
Then maybe you could accomplish it by doing a copy command. Copy the
file from its source to where you stage the war file, either before you
execute the war task or within the war task. After I usually run my
clean target, I do all my staging in the init target even if the
compiled classes paths don't exist yet! I create the directories and
copy my files in advance in the init target and when the javac task
runs, it has no problem or issues with the folders already pre-existing;
it would be the same as an incremental build or not running the clean
target. I hope this helps.
> Date: Fri, 12 Feb 2010 07:37:08 -0500
> Subject: Re: Copying external file into WAR
> From: romsok.tech@gmail.com
> To: user@ant.apache.org
>
> That would work for web.xml - but I would like to copy another,
unrelated
> properties file from an external dir to the WAR's WEB-INF.
> I looked at the examples in the manual, but maybe I am missing
something...
>
> On Thu, Feb 11, 2010 at 7:56 PM, Rez P <po...@hotmail.com> wrote:
>
> >
> > Check out the Ant manual, it has some examples. In the excerpt
below, all
> > you have to do in the war task is to change the location or path of
the
> > webxml attribute. If the web.xml is outside of your project in a
higher
> > heirachy than your project, all you have to do is to type the
absolute path,
> > starting at the root of the system and tell it where the web.xml is.
> >
> >
> >
> > e.g. /my/other/project/web.xml
> >
> >
> >
> > http://ant.apache.org/manual/index.html
> >
> >
> >
> > <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
> > <fileset dir="src/html/myapp"/>
> > <fileset dir="src/jsp/myapp"/>
> > <lib dir="thirdparty/libs">
> > <exclude name="jdbc1.jar"/>
> > </lib>
> > <classes dir="build/main"/>
> > <zipfileset dir="src/graphics/images/gifs"
> > prefix="images"/>
> > </war>
> >
> >
> > > Date: Thu, 11 Feb 2010 19:17:40 -0500
> > > Subject: Copying external file into WAR
> > > From: romsok.tech@gmail.com
> > > To: user@ant.apache.org
> > >
> > > Hi,
> > >
> > > Could someone please tell me how I can accomplish the following?
> > >
> > > I want to build a war file. Additionally there is a configuration
file
> > that
> > > is found outside of the WEB-INF directory, but when that WEB-INF
dir is
> > > packaged into the war I want to place that config file in WEB-INf
in the
> > war
> > > - without having to copy it into the actual WEB-INF before making
the WAR
> > > file.
> > >
> > > Thanks.
> >
> > _________________________________________________________________
> > Hotmail: Free, trusted and rich email service.
> > http://clk.atdmt.com/GBL/go/201469228/direct/01/
> >
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/201469230/direct/01/
_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
_____________
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Copying external file into WAR
Posted by Rez P <po...@hotmail.com>.
Then maybe you could accomplish it by doing a copy command. Copy the file from its source to where you stage the war file, either before you execute the war task or within the war task. After I usually run my clean target, I do all my staging in the init target even if the compiled classes paths don't exist yet! I create the directories and copy my files in advance in the init target and when the javac task runs, it has no problem or issues with the folders already pre-existing; it would be the same as an incremental build or not running the clean target. I hope this helps.
> Date: Fri, 12 Feb 2010 07:37:08 -0500
> Subject: Re: Copying external file into WAR
> From: romsok.tech@gmail.com
> To: user@ant.apache.org
>
> That would work for web.xml - but I would like to copy another, unrelated
> properties file from an external dir to the WAR's WEB-INF.
> I looked at the examples in the manual, but maybe I am missing something...
>
> On Thu, Feb 11, 2010 at 7:56 PM, Rez P <po...@hotmail.com> wrote:
>
> >
> > Check out the Ant manual, it has some examples. In the excerpt below, all
> > you have to do in the war task is to change the location or path of the
> > webxml attribute. If the web.xml is outside of your project in a higher
> > heirachy than your project, all you have to do is to type the absolute path,
> > starting at the root of the system and tell it where the web.xml is.
> >
> >
> >
> > e.g. /my/other/project/web.xml
> >
> >
> >
> > http://ant.apache.org/manual/index.html
> >
> >
> >
> > <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
> > <fileset dir="src/html/myapp"/>
> > <fileset dir="src/jsp/myapp"/>
> > <lib dir="thirdparty/libs">
> > <exclude name="jdbc1.jar"/>
> > </lib>
> > <classes dir="build/main"/>
> > <zipfileset dir="src/graphics/images/gifs"
> > prefix="images"/>
> > </war>
> >
> >
> > > Date: Thu, 11 Feb 2010 19:17:40 -0500
> > > Subject: Copying external file into WAR
> > > From: romsok.tech@gmail.com
> > > To: user@ant.apache.org
> > >
> > > Hi,
> > >
> > > Could someone please tell me how I can accomplish the following?
> > >
> > > I want to build a war file. Additionally there is a configuration file
> > that
> > > is found outside of the WEB-INF directory, but when that WEB-INF dir is
> > > packaged into the war I want to place that config file in WEB-INf in the
> > war
> > > - without having to copy it into the actual WEB-INF before making the WAR
> > > file.
> > >
> > > Thanks.
> >
> > _________________________________________________________________
> > Hotmail: Free, trusted and rich email service.
> > http://clk.atdmt.com/GBL/go/201469228/direct/01/
> >
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/201469230/direct/01/
Re: Copying external file into WAR
Posted by Roman Sokolyuk <ro...@gmail.com>.
That would work for web.xml - but I would like to copy another, unrelated
properties file from an external dir to the WAR's WEB-INF.
I looked at the examples in the manual, but maybe I am missing something...
On Thu, Feb 11, 2010 at 7:56 PM, Rez P <po...@hotmail.com> wrote:
>
> Check out the Ant manual, it has some examples. In the excerpt below, all
> you have to do in the war task is to change the location or path of the
> webxml attribute. If the web.xml is outside of your project in a higher
> heirachy than your project, all you have to do is to type the absolute path,
> starting at the root of the system and tell it where the web.xml is.
>
>
>
> e.g. /my/other/project/web.xml
>
>
>
> http://ant.apache.org/manual/index.html
>
>
>
> <war destfile="myapp.war" webxml="src/metadata/myapp.xml">
> <fileset dir="src/html/myapp"/>
> <fileset dir="src/jsp/myapp"/>
> <lib dir="thirdparty/libs">
> <exclude name="jdbc1.jar"/>
> </lib>
> <classes dir="build/main"/>
> <zipfileset dir="src/graphics/images/gifs"
> prefix="images"/>
> </war>
>
>
> > Date: Thu, 11 Feb 2010 19:17:40 -0500
> > Subject: Copying external file into WAR
> > From: romsok.tech@gmail.com
> > To: user@ant.apache.org
> >
> > Hi,
> >
> > Could someone please tell me how I can accomplish the following?
> >
> > I want to build a war file. Additionally there is a configuration file
> that
> > is found outside of the WEB-INF directory, but when that WEB-INF dir is
> > packaged into the war I want to place that config file in WEB-INf in the
> war
> > - without having to copy it into the actual WEB-INF before making the WAR
> > file.
> >
> > Thanks.
>
> _________________________________________________________________
> Hotmail: Free, trusted and rich email service.
> http://clk.atdmt.com/GBL/go/201469228/direct/01/
>
RE: Copying external file into WAR
Posted by Rez P <po...@hotmail.com>.
Check out the Ant manual, it has some examples. In the excerpt below, all you have to do in the war task is to change the location or path of the webxml attribute. If the web.xml is outside of your project in a higher heirachy than your project, all you have to do is to type the absolute path, starting at the root of the system and tell it where the web.xml is.
e.g. /my/other/project/web.xml
http://ant.apache.org/manual/index.html
<war destfile="myapp.war" webxml="src/metadata/myapp.xml">
<fileset dir="src/html/myapp"/>
<fileset dir="src/jsp/myapp"/>
<lib dir="thirdparty/libs">
<exclude name="jdbc1.jar"/>
</lib>
<classes dir="build/main"/>
<zipfileset dir="src/graphics/images/gifs"
prefix="images"/>
</war>
> Date: Thu, 11 Feb 2010 19:17:40 -0500
> Subject: Copying external file into WAR
> From: romsok.tech@gmail.com
> To: user@ant.apache.org
>
> Hi,
>
> Could someone please tell me how I can accomplish the following?
>
> I want to build a war file. Additionally there is a configuration file that
> is found outside of the WEB-INF directory, but when that WEB-INF dir is
> packaged into the war I want to place that config file in WEB-INf in the war
> - without having to copy it into the actual WEB-INF before making the WAR
> file.
>
> Thanks.
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/201469228/direct/01/