Create custom jruby-complete.jar


#1

Hello all,

I’ve read rumors that this is possible, but I haven’t been able to find
instructions: how do I build a custom jruby-complete.jar (i.e. including
gems that are not part of the standard jruby-complete.jar).

Thanks,
Roy


#2

A jar file is just a zip with some extra data. You can unzip the
jruby-complete.jar file, add/remove items at your leisure (gem unpack)
and then zip it all back up again.

David K.

On Apr 21, 2009, at 3:55 PM, Roy T. wrote:

Hello all,

I’ve read rumors that this is possible, but I haven’t been able to
find instructions: how do I build a custom jruby-complete.jar (i.e.
including gems that are not part of the standard jruby-complete.jar).

Thanks,
Roy


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#3

Roy T. wrote:

Hello all,

I’ve read rumors that this is possible, but I haven’t been able to find
instructions: how do I build a custom jruby-complete.jar (i.e. including
gems that are not part of the standard jruby-complete.jar).

Look at the jar-complete target in build.xml.

In there, there is a maybe_install_gems command where you should be able
to add more gems for it to install into the staging directory before it
jars it up.

This has not been tried as such, but I have tinkered with the same spot
in the build to make it not install the gems to there (I manually copy
them from elsewhere to avoid using the network during the build.)

TX


#4

Roy T. wrote:

Hello all,

I’ve read rumors that this is possible, but I haven’t been able to find
instructions: how do I build a custom jruby-complete.jar (i.e. including
gems that are not part of the standard jruby-complete.jar).

As David pointed out, it’s just a zip file of a particular structure, so
you can modify it yourself. I believe some folks have done exactly what
you hope to do, e.g. including gem-based libraries directly in the jar
file.

I would, however, like to automate this process. It would not be
difficult to build a “complete jar builder” that also sucked in
installed gems (perhaps based on a list or based on checking loaded gems
in a bootstrapped application?) and included them in the complete jar.
This would make shipping applications much easier.

Since it’s just a zip file, maybe you or someone else can come up with a
script to install gems? We could then improve it and probably include it
in JRuby.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email