Mark Robinson
Mark Robinson

Reputation: 3175

Changing configuration files at build/deploy time

I've got a J2EE project which stores some of it's configuration in built-in XML files.

Now, some of the information in these files needs to change based on where it is deployed. Ie, the parameters are different for development, testing, release, etc.

Is there a way I can alter these configuration files without having to maintain separate copies of each file for each environment?

Upvotes: 1

Views: 85

Answers (1)

artbristol
artbristol

Reputation: 32437

If you're building it with Maven, you can use resource filtering to change values in your XML files - you leave a placeholder there which gets replaced with a property value depending on the profile (dev, uat, etc.) you have selected.

Upvotes: 3

Related Questions