Writing JRuby Code That Depends on Gem and Maven Projects

While the question was asked more than six months ago, I am wondering what is the best way to write JRuby code, which depends on gems, but also on Maven Projects. The Bundler seems to be the standard Maven tool for the Ruby community, and I would prefer to use it, but it looks like the provider will not support Maven dependencies .

Is gem install mvn:<groupId>:<artifactId> only real solution? Would I just put this in a rakefile? Are people doing all their gem setting with a rake instead of a bunch? Does anyone have any other suggestions to solve this problem? Thanks.

+7
source share
2 answers

I found my answer in jbundler . With jbundler, you define an Mvnfile that is similar to a Gemfile , and place your Maven dependencies there.

 repository 'http://your-local-repo-here/' jar 'groupId:artifactId', '1.0.0-SNAPSHOT' ... 

jbundler even works with locally installed (in your .m2 / repositories) banks, allowing you to integrate with your Java project during development.

Since it integrates with the Bundler, there is no need to use another tool to reduce your dependencies on Maven. Just bundle install; bundle exec something.rb bundle install; bundle exec something.rb . Oddly enough, Maven's dependency resolution happens in bundle exec time, not bundle install , but I can live with it.

+6
source

So, I was the one who wrote this and ran into some resistance, as you can say :-). Here is a blog post that describes it in more detail: http://hokiesuns.blogspot.com/2012/02/bundler-maven-for-your-jruby-projects.html

If this helps you, then please send a message indicating as such, or if you think jbundler is working, this may also be a good solution (I have not looked at it in detail, but it looks interesting) and I'm glad that my work inspired someone else!

0
source