Tell me more ×  Part of my webapp involves uploading image
files. On the production server, the files will need to be
written to /somepath_on_production_server/images. For local
development, I want to write the files to
/some_different_path/images.  What's the best way to handle
these configuration differences?  One important requirement is
this: I don't want to have to mess with the production server at
all, I just want to be able to deploy a war file and have it
work. So I don't want to use any technique which will require me
to mess with the environment variables/classpath/etc. on the
production machine. I'm fine with setting those on my local
machine though.  I'm imaginine two possible general approaches:
1. loading a special "dev" configuration file at runtime if
certain conditions are met (environment variable/classpath/etc)
2. flipping a switch during the build process (maven profiles
maybe?) share|improve this question add comment  3 Answers  up
vote 2 down vote accepted  Simple things like a Str