This might be more of an ANT or deployment question, but I'll start here. If it belongs elsewhere, we can move the thread.
I've been putting assorted .properties files in the WEB-INF/classes directory, and it works fine.
But, I've checked in these files into SVN, and when a user does a checkout, they get the "standard" versions. And that may not be where we want to get them, or where they should be.
The problem is that I put lots of stuff in the properties, such as host name for SMTP servers, the Host and URL for JDBC, usernames for the "from" field of outgoing email notices, etc. When I'm developing, I usually want to use a non-production set of values. And I can see that the marketing folks might want a copy on their laptops to show in demos. Clearly "production" wants real values.
Bear Bibeault wrote:I keep mine in a folder in the source tree and copy them to classes folder as part of the ant build.
But aren't all the files and folders in your source tree checked into SVN?
I was thinking of some hack where I look for a magic enviroment variable, something like PAT_CONFIG_HOME, and if its there, read from there, else let
the usual WAR/JAR rules hold. This feels like a hack.
I usually end up with a hostname-based solution and/or a system property name-based one, either home-brewed or through a Spring-based PropertyPlaceholderConfigurator extension. We've always checked in developer-/host-specific files, although sometimes we've ended up with "local.properties"-like files that aren't under version control. I try to avoid that when possible.
There's the "official" properties files in the source tree. When a developer is running a local copy, he copies them to his classes folder and makes any necessary local changes. These are not part of the source tree and so there is no danger of them getting checked in with local changes.
During a build, the "official" versions become part of the war file for deployment.
subject: Where is a good place to put application-wide properties files