Gemspec trait includes all files
When using the gemspec trait all the files in my directory are included in the WAR file. The culprit seems to be this line in Warbler::Traits::Gemspec#update_archive. I had been using Bundler with the gemspec command and the --path=./gems option to pull my dependencies out of the gemspec file but had to switch back to a straight up Gemfile as it was including both the dependencies from Bundler and copying everything into WEB-INF as well.
So if I have the following:
src/
tmp/
vendor/gems/
vendor/jars/
I'd get something like:
WEB-INF/src/
WEB-INF/gems/
WEB-INF/tmp/
WEB-INF/vendor/gems/
WEB-INF/vendor/jars/
This is compounded by the gemspec trait not honoring config.excludes. Also, it seems impossible to turn off the gemspec trait by manually setting the config.traits option as it reappears when passed to Warbler::Task.new.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I've taken to doing this at the top of my config/warble.rb:
# Setting config.traits simply does not work.
# https://github.com/jruby/warbler/issues/94
module Warbler::Traits
def auto_detect_traits
[Jar, Bundler, NoGemspec]
end
end