mkristian / jar-dependencies

manage jar dependencies for ruby gems
MIT License
34 stars 19 forks source link

ENV['JARS_HOME'] ignored when vendoring with jruby-9k #54

Closed sonya closed 7 years ago

sonya commented 7 years ago

I have a Rakefile that contains this:

task :install_jars do
  ENV['JARS_HOME'] = Dir.pwd + "/vendor/jar-dependencies/runtime-jars"
  ENV['JARS_VENDOR'] = "false"
  Jars::Installer.new.vendor_jars!(false)
end

When I run bundle exec rake install_jars with jruby-1.7.22, it creates a vendor directory in my current directory.

When I run bundle exec rake install_jars with jruby-9k (I tried 9.1.2.0 and 9.1.6.0), it does not create a vendor directory. However if I run:

JARS_HOME=./vendor/jar-dependencies/runtime-jars bundle exec rake install_jars

with jruby-9k, it does create a vendor directory. So it seems that ENV variables defined in the rake task are treated differently across ruby versions.

mkristian commented 7 years ago

probably there is not much I can from the gem point of view. jruby-9k does use it for example with jruby-openssl, i.e. whenever there is a require 'openssl' then internally Jars.home, etc get set.

what you can do is to add Jars.reset after setting the ENV