It can be very useful to provide a configuration mechanism that uses files that are located outside of the source and resources directories. The advantages are:
Passwords cannot (by accident) be commited to an online repo.
A clear distinction between default properties and the ones specific to a deployment or installation.
Configuration is independent of the build procedure.
In the following links to source code of implementations of loading properties files are provided. Please feel free to extend this page.
For compile time configuration using Maven see also BestPracticeDifferentPropertySetsInMaven.