NUBIC/buildr-gemjar — Issue #4: Enable the packaging of gems with embedded jars
Author: rsutphin
Created: 2012-02-08 20:53:58+00:00
State: open

A jar which is packaged inside a gem that is packaged inside another jar is not visible to JRuby. To support this case, [JRuby looks for][ml] the contents of the embedded jar on the classpath in addition to from the jar itself.

Extend `buildr-gemjar` to support this case by unpacking embedded jars when packaging gems. This should be controllable on a per gem basis like so:

package(:gemjar).with_gem('foo', '1.0.0', :unpack_jars => true)

Acceptable values for `:unpack_jars` should be:

* a glob like `'lib/**/*.jar'`, or an array of such globs. The glob will be matched within the `gems/foo-1.0.0` (e.g.) directory. Any matching files will be unpacked.
* `true`. A shortcut for the glob `'lib/**/*.jar'`.
* `false`. Don't unpack any jars.

Default should be `true`.

[ml]: http://ruby.11.n6.nabble.com/jruby-openssl-gem-within-a-java-web-start-deployment-td3454433.html