RE: filtering resources - switching whole files

2008-04-10 Thread Bernhard David
Hi,

I think this'll do the trick:

make differrent directories like src/main/dev, src/main/prod etc. and
set up the POM:

profiles
  profile
iddev/id
build
  resources
resource
  directorysrc/main/dev/directory
/resource
  /resources
/build
   /profile 

and so on. Then with mvn -P dev you choose a profile, and only the
files from that profile will be copied. Any resources you declare
outside of the profiles (regular build) will be copied for all
profiles.

David

 -Original Message-
 From: Nick Stolwijk [mailto:[EMAIL PROTECTED] 
 Sent: 10 April 2008 00:10
 To: Maven Users List
 Subject: Re: filtering resources - switching whole files
 
 For different config files I often do it with an include. I.e. spring 
 configuration for production, test, dev, make a main 
 applicationContext.xml which includes 
 database-${environment}.xml. Now 
 you can switch config files between builds. (Or at runtime, 
 if you don't 
 filter.
 
 Hth,
 
 Nick S.
 
 Jan Zelenka wrote:
  Hi,
  I have different config files for various build targets 
 (dev, test, prod), 
  but I cannot use standard resource filtering because whole 
 portions of the 
  files are diferrent, not just simple strings. In Ant I have 
 a copy of the 
  file for each target and just copy/rename them during 
 build. What would be 
  the best way to do this in maven? Preferably using profiles 
 to choose 
  targets.
 
  Thank you,
  Jan
   

 
 -
 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]



filtering resources - switching whole files

2008-04-09 Thread Jan Zelenka
Hi,
I have different config files for various build targets (dev, test, prod), 
but I cannot use standard resource filtering because whole portions of the 
files are diferrent, not just simple strings. In Ant I have a copy of the 
file for each target and just copy/rename them during build. What would be 
the best way to do this in maven? Preferably using profiles to choose 
targets.

Thank you,
Jan
 

Re: filtering resources - switching whole files

2008-04-09 Thread Nick Stolwijk
For different config files I often do it with an include. I.e. spring 
configuration for production, test, dev, make a main 
applicationContext.xml which includes database-${environment}.xml. Now 
you can switch config files between builds. (Or at runtime, if you don't 
filter.


Hth,

Nick S.

Jan Zelenka wrote:

Hi,
I have different config files for various build targets (dev, test, prod), 
but I cannot use standard resource filtering because whole portions of the 
files are diferrent, not just simple strings. In Ant I have a copy of the 
file for each target and just copy/rename them during build. What would be 
the best way to do this in maven? Preferably using profiles to choose 
targets.


Thank you,
Jan
 
  


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