如何使用 warbler 将 jruby-jars 和 jruby-rack 添加到类路径中?
我一直在阅读 warbler 源代码,但我无法弄清楚 jruby-jar 和 jruby-rack jar 是如何最终出现在 servlet 类路径上的?
Warbler 似乎正在将它们复制到 web-inf/gems/gems/
中,但它们不在类路径上。
我猜如果我把它们放在我的 ruby apps lib/ 文件夹中,它们将被复制到 web-inf/lib 中,一切都会好起来,但是,在 war 文件中有 2 个 jar 副本似乎很奇怪,是那是我应该做的吗?
本
I've been reading through the warbler source code, and I can't figure out how the jruby-jars and jruby-rack jars are meant to end up on the servlet classpath?
It seems warbler is copying them into web-inf/gems/gems/<gemname>/lib/<jarname>.jar
but they are not on the classpath.
I'm guessing that if I put them in my ruby apps lib/ folder they would be copied to web-inf/lib and all would be well, however, it seems odd to have 2 copies of the jar in the war file, is that what I am meant to do?
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应将它们复制到 WEB-INF/lib/.jar 中。用于定位 jar 的代码位于:
http ://github.com/nicksieger/warbler/blob/master/lib/warbler/config.rb#L216-220
将它们复制到 WEB-INF/lib 的代码在这里:
http://github.com/nicksieger/warbler/blob/master /lib/warbler/war.rb#L68-70
如果您看到其他内容,那么这是一个错误。另外,您不必显式声明对 JRuby jar 文件 gems 的依赖关系。
They should be copied into WEB-INF/lib/.jar. The code for locating the jars is here:
http://github.com/nicksieger/warbler/blob/master/lib/warbler/config.rb#L216-220
And the code that copies them into WEB-INF/lib is here:
http://github.com/nicksieger/warbler/blob/master/lib/warbler/war.rb#L68-70
If you're seeing something else, then it's a bug. Also, you shouldn't have to explicitly state dependencies on the JRuby jar file gems.