JRuby - Warbler does not preserve symbolic links

2019-05-17 01:10发布

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"

2条回答
地球回转人心会变
2楼-- · 2019-05-17 01:34

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.

查看更多
ら.Afraid
3楼-- · 2019-05-17 01:37

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.

查看更多
登录 后发表回答