JRuby - Warbler 不保留符号链接
使用 warbler 打包应用程序时,符号链接会丢失,符号链接指向的实际内容将打包为 WAR 的一部分。
就我而言,我有一个从 public/images/upload 到 /var/myproject/upload 的符号链接。在 tomcat 中部署 war 后,在展开的文件夹 public/images/upload 中,/var/myproject/upload 的所有内容都复制到其中,而不是链接到该文件夹。
更新:我的问题是“当作为战争部署时,warbler 会保留项目内的符号链接吗?”
环境信息:
jruby 1.6.2 (ruby-1.8.7-p330) | jruby 1.6.2 (ruby-1.8.7-p330) |莺1.3.1 | Cent操作系统5.5 | Java SE“1.6.0_26”
When packaging the application using warbler, the symbolic links are lost and the actual contents the symlink points to are packaged as part of the WAR.
In my case, I have a symlink from public/images/upload to /var/myproject/upload. After I deploy the war in tomcat, in the exploded folder public/images/upload has all the contents of /var/myproject/upload copied to it instead of linking to the folder.
UPDATE: My questions is "will warbler retain the symbolic links inside the project when deployed as a war?"
Environment Info:
jruby 1.6.2 (ruby-1.8.7-p330) | warbler 1.3.1 | Cent OS 5.5 | Java SE "1.6.0_26"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也有同样的问题。我通过为环境文件中使用的每个路径创建全局(@@)变量来解决这个问题。例如,我的 Production.rb 文件包含 @@rejectedPage="/pathto/page/in/tomcat",而在我的development.rb 文件中,我设置 @@rejectedPage="/the/normal/path"。这样我就可以轻松地从开发环境切换到生产环境。
I had the same problem. I solved it by creating global (@@) variables for each path that I used in the environment files. For example my production.rb file contains @@rejectedPage="/pathto/page/in/tomcat", while in my development.rb file I set @@rejectedPage="/the/normal/path". This way I can easily switch from my development environment to my production environment.
Warbler 目前不支持符号链接,因此它会尝试复制其内容。最好的选择是将 Warbler 配置为忽略该链接,并使用其他存储该链接的程序对 .war 文件进行后处理。
请随意为此提交功能请求,或者更好的是提交补丁/拉取请求。
Warbler does not support symbolic links currently, so it tries to copy its contents. Your best bet is to configure Warbler to ignore the link and post process the .war file with some other program that would store the link.
Feel free to file a feature request for this, or better, submit a patch/pull request.