如何在Warbler中添加META-INF / context.xml

如何在战争中添加META-INF / context.xml?我在config / warble.rb中找不到任何配置条目。     
已邀请:
不幸的是尼克的方法不起作用。该文件实际上已复制到WEB-INF / META-INF / context.xml。 我终于找到了将context.xml复制到META-INF的方法: 在rails app根文件夹下创建META-INF / context.xml 取消注释并更改config / warble.rb中的以下行
config.public_html = FileList["public/**/*", "doc/**/*", "META-INF/context.xml" ]
基本上将META-INF视为public_html,它将被复制到webapps / youapp / META-INF。     
你必须自己添加一个。您可以在项目中创建
META-INF/context.xml
目录和文件,并在
config/warble.rb
中将
META-INF
添加到
config.dirs
,也可以添加“pathmap”将context.xml文件重命名为war文件中的META-INF目录。
config.pathmaps.application += ["%{context.xml,META-INF/context.xml}p"]
    
解决这个问题的更好方法可能是在
warble.rb
文件中使用以下内容。
config.script_files << 'path_to_file/context.xml'
请参阅https://github.com/jruby/warbler/blob/master/lib/warbler/config.rb底部的文档
# These file will be placed in the META-INF directory of the jar or war that warbler
# produces. They are primarily used as launchers by the runnable feature.
attr_accessor :script_files
    

要回复问题请先登录注册