Comparison of configuration libraries for Java

Comparison of configuration libraries for Java - cfg4j, commons configuration and others.


  • cfg4j - fairly young project, targeting distributed apps. Supports modern configuration stores like Consul and git repositories. Offers interface binding and strongly-typed configuration properties.

  • Commons Configuration - old and well-known configuration library for Java. Focused on reading from local files.

Feature comparison

Feature cfg4j commons configuration
license Apache 2.0 Apache 2.0
version used 3.3.2 2.0 beta 1
supported configuration stores Consul, Git repository, Files, Classpath JDBC, Files
supported file formats yaml, properties properties, xml, ini, openstep
supported data types BigDecimal, BigInteger, URI, URL, File, Class, Enum, Number, String, most Collection interfaces and classes, most Map interfaces and classes, primitive types, boxed types, arrays BigDecimal, BigInteger, String, primitive types, boxes types
accessing configuration single properties, interface binding single properties
configuration reload periodical, manual periodical, manual
caching yes yes
merge multiple sources yes yes
integration with DI containers yes yes
multi-tenant configurations yes yes
code samples github blog post

Dialogue & Discussion