Skip to content
Simple configuration for the JVM.
Java Shell
Find file
Latest commit 23db74a Mar 24, 2012 @criccomini adding scala readme
Failed to load latest commit information.
fig-cli rename to autoloader Mar 24, 2012
fig-core cleaning up scala test pom stuff Mar 24, 2012
fig-example remove warnings. update readme. remove parent pom relative path. Mar 23, 2012
fig-scala_2.9.1 cleaning up scala test pom stuff Mar 25, 2012
fig-zookeeper config now implements map. Mar 23, 2012
.gitignore renaming configuration to config because i'm a bit ocd Mar 23, 2012 adding license, contributors, and change log Mar 24, 2012 adding license, contributors, and change log Mar 24, 2012
LICENSE adding scala readme Mar 24, 2012


Fig is a simple configuartion library for the JVM.


  • No static methods
  • Pluggable
  • No types
  • Stupid simple
  • Immutability
  • Scala support

Using Fig

Fig is really easy to use. I promise.

Let's use Fig with a Java property file.


Now, in Java, you can get your properties.

Config config = new AutoLoader().getConfig(new URI("file:///tmp/"));
System.out.println("hello " + config.get("hello"));

Scala Implicits

Fig also has an implicit to make life easier for Scala users.

import fig.scala.conversions.ConfigConversions._
val config: Config = new URI("file:///tmp/")
println("hello " + config.get("hello"));

Command Line Execution

Fig also provides an easy way to execute programs from the CLI using config (instead of CLI arguments).

Let's create another Java property file.


The main-class allows us to execute the MyConfigPrinter.

./bin/ --config-path=file:///tmp/

It really is that simple!

Example Project

Fig has an example project called "fig-example", which demonstrates how to use Fig with the script.

Follow these instructions to try things out.

git clone git://
cd fig
mvn clean package
cd fig-example/target
cd fig-example
./bin/ --config-path=file://`pwd`/config/

This will execute a little Java class that prints the configuration in


Fig comes with a lot of FileSystems and ConfigDeserializers out of the box, but you can always extend Fig to use your own config system by using the following Java properties.


Now, AutoLoader will support URIs with an HTTP or HDFS scheme (http://.. or hdfs://..) and YAML config files (*.yaml).

new AutoLoader().getConfig(new URI("http://localhost/my-config.yaml"));

How great is that?

Rules of the Game

Since configuration is often a core and pervasive part of an API, Fig makes the following guarantees.

  1. Fig uses semantic versioning (, and will never make backwards incompatible changes without bumping the major version (*.0.0).
  2. Fig's core library (fig-core) will never have any dependencies.
Something went wrong with that request. Please try again.