Using Maven artifacts as gems

Hello all,

I have been working on Ehcache integration for JRuby and Rails. There
are
three gems for this:

jruby-ehcache
jruby-ehcache-rails2
jruby-ehcache-rails3

Currently, the latest Ehcache JAR is embedded in the jruby-ehcache gem.
I
would rather have the jruby-ehcache gem simply declare a dependency on
the
Ehcache Maven artifact instead so that we don’t need to include the
rather
large Ehcache JAR within the gem itself, and also to make it easier to
use
updated versions of Ehcache in the future.

Is this currently possible? If so, can someone give me a brief tutorial
on
how to accomplish it?

(Note: I’ve done some searching but the information I’ve found on this
topic
seems to be out of date.)

Thanks!

http://jira.codehaus.org/browse/JRUBY-5102
is the what you need.

clone http://github.com/jruby/jruby
apply the patch from the above issue.

use that jruby version from the source tree $CLONE_OF_JRUBY/bin/jruby
and then you should be able to use a maven artifact as gem:

. is the gemname you need to use, i.e.
net.sf.ehcache.ehcache

and you can to require runtime jars (compile + runtime scope in maven
speak) with:

require ‘maven/net.sf.ehcache/ehcache’

or the development jars (i.e. test + provided scope in maven speak)
with:

require ‘maven/net.sf.ehcache/ehcache-dev’

about timeline and getting it into jruby main branch someone else
needs to answer this.

but in case you have any problems PLEASE let me know so we can fix it
!!!

regards Kristian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs