While a similar question was asked more than half a year ago, I’m wondering what the best way to write JRuby code that’s depending on gems but also depending on Maven projects. Bundler seems to be the standard Maven like tool for the Ruby community, and I’d prefer to use that, but it looks like bundler won’t be supporting Maven dependencies.
Is gem install mvn:<groupId>:<artifactId> the only real solution? Would I just put that into a Rakefile? Do people then do all their gem installations with rake instead of bundler? Does anyone have other suggestions of approaching this problem? Thank you.
I found my answer in jbundler. With jbundler you define a
Mvnfile, which looks similar to aGemfile, and put your Maven dependencies there.jbundler even works with locally installed (in your .m2/repository) jars, letting you integrate with your work-in-progress Java project.
Since it integrates with Bundler, there’s no need to use another tool to pull down your Maven dependencies. Just
bundle install; bundle exec something.rb. Strangly, the Maven dependency resolution happens atbundle exectime and notbundle install, but I can live with that.