Re: How to rename or copy resource files when packaging war-file

2008-10-10 Thread Stephen Coy
I agree with the other guys in that it is way better to externalise  
your configuration.


In the meantime, it is probably easier to put each foo.xml in  
different directories, say src/main/resources-prod and src/main/ 
resources-dev. Then use profiles to select different build  
configurations. Refer to http://maven.apache.org/plugins/maven-resources-plugin/ 
 for information on how to do resources configuration.


Alternatively, you could use the same foo.xml and filter copy it,  
specifying the property values to be substituted in profiles instead.


Cheers

On 10/10/2008, at 1:27 AM, Johan Hammar wrote:


Hi!

In my project I have two files, foo-dev.xml and foo-production.xml, in
src/main/resources. When I package the project as a war-file I want to
rename or copy one of those files to foo.xml. Which file to rename or
copy depends on which profile I run maven with. Is this possible and
where can I learn more about this?

Regards,
Johan Hammar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to rename or copy resource files when packaging war-file

2008-10-09 Thread Johan Hammar
Hi!

In my project I have two files, foo-dev.xml and foo-production.xml, in
src/main/resources. When I package the project as a war-file I want to
rename or copy one of those files to foo.xml. Which file to rename or
copy depends on which profile I run maven with. Is this possible and
where can I learn more about this?

Regards,
Johan Hammar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to rename or copy resource files when packaging war-file

2008-10-09 Thread Michael McCallum
why not externalise - as in not in the war - the configuration? because by 
inferrence you are talking about rebuilding your war file for different 
environments... how do you guarantee that its the same without a bunch of 
extra hassle?


On Fri, 10 Oct 2008 03:27:04 Johan Hammar wrote:
 Hi!

 In my project I have two files, foo-dev.xml and foo-production.xml, in
 src/main/resources. When I package the project as a war-file I want to
 rename or copy one of those files to foo.xml. Which file to rename or
 copy depends on which profile I run maven with. Is this possible and
 where can I learn more about this?

 Regards,
 Johan Hammar

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-- 
Michael McCallum
Enterprise Engineer
mailto:[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to rename or copy resource files when packaging war-file

2008-10-09 Thread Johan Hammar
Yes, that is of course the best solution, however our way of doing it
is just temporary until we get some other stuff sorted out. I'm still
interested if it is possible or not.

Thanks,
Johan

On Thu, Oct 9, 2008 at 8:56 PM, Michael McCallum [EMAIL PROTECTED] wrote:
 why not externalise - as in not in the war - the configuration? because by
 inferrence you are talking about rebuilding your war file for different
 environments... how do you guarantee that its the same without a bunch of
 extra hassle?


 On Fri, 10 Oct 2008 03:27:04 Johan Hammar wrote:
 Hi!

 In my project I have two files, foo-dev.xml and foo-production.xml, in
 src/main/resources. When I package the project as a war-file I want to
 rename or copy one of those files to foo.xml. Which file to rename or
 copy depends on which profile I run maven with. Is this possible and
 where can I learn more about this?

 Regards,
 Johan Hammar

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 --
 Michael McCallum
 Enterprise Engineer
 mailto:[EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]