The Commons Configuration software library provides a generic configuration interface which enables a Java application to read configuration data from a variety of sources. Commons Configuration provides typed access to single, and multi-valued configuration parameters as demonstrated by the following code:
Double double = config.getDouble("number"); Integer integer = config.getInteger("number");
Configuration parameters may be loaded from the following sources:
The full Javadoc API documentation is available here.
The latest stable release of Apache Commons Configuration is version 1.10. It is available from the Apache download area. It is also available from the Maven repository. The Changes Report explains all of the changes and bug fixes that have been made.
In the meantime, work has been spent on a major redesign of the library addressing some of the weaknesses of the 1.x version series. The results are now made available as an alpha release. This release aims at gaining feedback from the community regarding changed and new concepts implemented for version 2.0. It is not yet production ready! The version is also available from the Download page. There is a Migration guide that can be used as guideline when upgrading from version 1.x to 2.0. It describes the most important changes.
Commons Configuration started as code in Apache JServ. The JServ code was subsequently added to Jakarta Turbine. After Jakarta Turbine, this configuration interface moved to Jakarta Velocity and underwent various improvements. After Velocity, this code was introduced to the Apache Commons as ExtendedProperties. Configuration began life in the Commons as a Sandbox component, and was promoted to the Commons Proper in late 2003.