在 Maven 中使用捆绑器、git 和 jRuby gems 的最佳实践是什么?
我使用 jRuby 和 Rails 有一段时间了,但我不觉得我已经找到了圣杯: 我正在做很多 gem,它们是实际 java 库的包装器,我问自己打包这些 gem 的最佳选择是什么。 将它们打包为“原生 gem”,让 jar 在安装 gem 时打包,这是一个好主意吗? 有没有办法将 jars 安装在 .m2 目录中,让bundler和maven同时做他们能做的最好的事情?
最好的,
托比亚斯
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,有一种简单的方法可以将 java 库安装为 gem:
这应该可以解决一些问题。
不幸的是,bundler 似乎不支持它们。
看
http://blog.mkristian.tk/2011/03/rubygems-maven -support.html
和
http://blog.mkristian.tk/2011/09/jruby -and-rubygems-and-javaclassloader.html
此外,切换到 Buildr 作为构建工具而不是 mvn 会使事情变得更容易。
Okay, there is an easy way to install java libraries as gem:
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.
RubyGems Maven 支持自 jruby 1.7 起已删除
请参阅此RubyGems maven 支持已在 JRuby 1.7 中删除
因此,这不适用于 jruby 1.7:
使用 jbundler 代替,请参阅 https://github.com/mkristian/jbundler
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:
Using jbundler instead, refer to https://github.com/mkristian/jbundler