How to add META-INF / context.xml to Warbler

How to add META-INF / context.xml to the war? I did not find the entry in config / warble.rb.

+3
source share
3 answers

Unfortunately, the Nick method does not work. The file is actually copied to WEB-INF / META-INF / context.xml.

I finally found a way to copy context.xml to META-INF:

  • create META-INF / context.xml under your rails application root folder
  • uncomment and change the following line in config / warble.rb

    config.public_html = FileList["public/**/*", "doc/**/*", "META-INF/context.xml" ]

Basically handle META-INF as public_html and it will be copied to webapps / youapp / META-INF.

+3
source

. META-INF/context.xml , META-INF config.dirs config/warble.rb "", context.xml META-INF .

config.pathmaps.application += ["%{context.xml,META-INF/context.xml}p"]
0

The best way to solve this problem might be to use the following in your file warble.rb.

config.script_files << 'path_to_file/context.xml'

See the documentation at the bottom of 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
0
source

All Articles