问题
I'm working with jRuby and Rails for a while, but I don't have the feeling that I've found the holy grail for this: I'm doing a lot of gems which are wrappers for actual java libs and I ask myself what the best option is for packaging those gems. Is it a good idea to package them as "native gems", letting the jars being packaged when the gem is installed? Is there a way to install the jars in the .m2 dir, letting bundler AND maven to what they can do best at the same time?
Best,
Tobias
回答1:
Okay, there is an easy way to install java libraries as gem:
gem install mvn:<groupId>:<artifactId>
Which should solve some of the problems. Unfortunately, bundler does not seem to support them.
See http://blog.mkristian.tk/2011/03/rubygems-maven-support.html
and
http://blog.mkristian.tk/2011/09/jruby-and-rubygems-and-javaclassloader.html
Also, switching to Buildr as build tool instead of mvn makes things easier.
回答2:
RubyGems Maven support removed since jruby 1.7
see this RubyGems maven support has been removed in JRuby 1.7
So, that won't work with jruby 1.7:
gem install mvn:<groupId>:<artifactId>
Using jbundler instead, refer to https://github.com/mkristian/jbundler
来源:https://stackoverflow.com/questions/7871115/whats-the-best-practice-for-using-bundler-git-and-jruby-gems-with-maven