如何将META-INF/context.xml添加到war包中?我在config/warble.rb文件中没有找到任何配置入口。
你需要自己添加一个。你可以在项目中创建一个 META-INF/context.xml
目录和文件,并将 META-INF
添加到 config/warble.rb
中的 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
config.public_html += FileList["META-INF/context.xml"]
- Araxia