Skip to content

Using Maven libraries from JRuby

Thomas Russell Murphy edited this page Jun 11, 2013 · 5 revisions

Notice: This does not currently work with jgems and the feature itself may have been removed.

JRuby's version of rubygems has support for treating Maven dependencies as if they are gems. Just gem install mvn:[groupId]:[artifactId] and then require 'mvn:[groupId]:[artifactId]' in your ruby code.

An example:

gem install mvn:com.yammer.metrics:metrics-core

require 'java'
require 'rubygems'
require 'mvn:com.yammer.metrics:metrics-core'

counter = com.yammer.metrics.Metrics.new_counter(...)

Clone this wiki locally