What's the best practice for using bundler, git, and jRuby gems with maven?

橙三吉。 提交于 2019-12-07 06:45:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!