Jetty 6 到 Jetty 7 升级:系统属性“jetty.lib”发生了什么? (-Djetty.lib=my/lib/dir)
看起来 Jetty 团队想要在版本 6 和 7 之间进行一些春季清理,并且看起来好像一个有用的系统属性“jetty.lib”要么不存在,要么不起作用,或者只是以一种未指定的方式发生了更改,以便为了使我的 jetty 6 设置能够轻松地与 Jetty 7 配合使用。
我尝试搜索 Jetty 7 文档,但我看到的唯一参考是“一些常用属性(例如“jetty.home”)仍然像以前一样工作”。
那么,我错过了什么?我真的想避免弄乱 Jetty 发行版目录中的内容(否则我可以 - 也许我必须? - 只需使用 JETTY_BASE/lib/ext ),这就是“jetty.lib”的用处。
Looks like Jetty team wanted to do some spring cleaning between versions 6 and 7, and it looks as if one useful system property, "jetty.lib" either does not exist, does not work, or just has changed in an unspecified way so as to make my jetty 6 set up work easily with Jetty 7.
I tried searching through Jetty 7 docs, but about the only reference I saw was that "some commonly used properties (such as "jetty.home") still work as they used to".
So, what am I missing? I really would want to avoid messing with things within Jetty distribution dirs (otherwise I could -- and maybe I have to? -- just use JETTY_BASE/lib/ext), and that's what "jetty.lib" was useful for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,看起来答案隐藏在“start.config”(捆绑在 start.jar 中)中,它定义了基本路径设置。具体来说,在第一行中,我们有:
# 添加属性定义的类路径
${path}.path 属性路径
# 添加属性定义的库目录
${lib}/** 存在 ${lib}
所以人们可能会认为要使用的属性是:
java -jar start.jar -Dlib=mydir/lib
但情况并非如此:技巧是这里的花括号意味着它必须是“属性”(而不是“属性或系统属性”)。因此真正需要的是:
java -jar start.jar lib=mydir/lib
或至少看起来可行。
作为额外的好处,看起来您还可以通过执行
java -jar start.jar -DSTART=my-start.config ...
来覆盖“start.config”以使用...这将完全重新定义用于设置路径的方法。
我希望其他人觉得这很有用。
更新:这个 Jetty 文档 更好地解释了上面的大部分内容......
Ok looks like answer was hidden within "start.config" (bundled in start.jar), which defines fundamental path settings. Specifically, among first lines, we have:
# add a property defined classpath
${path}.path property path
# add a property defined library directory
${lib}/** exists ${lib}
so one might think property to use would be:
java -jar start.jar -Dlib=mydir/lib
but this is not the case: trick being that here curlies mean that it has to be a "property" (not "property or system property"). And hence what is really needed is:
java -jar start.jar lib=mydir/lib
or at least that seems to work.
As an added bonus, it looks you could also override "start.config" to use by doing
java -jar start.jar -DSTART=my-start.config ...
which would give full power of redefining method used for setting paths altogether.
I hope others find this useful.
UPDATE: This Jetty doc explains most of above even better...