They say that a Java framework is not complete until it provides factories, and since it’s something that JCommander was still lacking, it had to be fixed.

Introducing JCommander 1.4.

Here is what’s new:

  • You can now specify default values in a more flexible way than at field declaration time (documentation).
  • You can use string converter factories instead of specifying converter classes on each @Parameter annotation (documentation).
  • The usage is now prettier:
    Usage: <main class> [options]
        -debug          Debug mode (default: false)
        -groups         Comma-separated list of group names to be run
      * -log, -verbose  Level of verbosity (default: 1)
        -long           A long number (default: 0)
  • Many bug fixes and a more clever option parsing to cover odd cases.
  • This release actually contains more features but I’m not telling.

All the goodness available at the usual place. Operators are standing by, order now!