Closed dgolombek closed 8 years ago
@dgolombek jar-dependencies comes with the jruby jar itself and before version 0.3.1 there was no SKIP_LOCK. even if I do not understand why both jar_dependencies.rb files can be loaded, could just verify if your jar has /META-INF/jruby.home/lib/ruby/stdlib/jar_dependencies.rb without this SKIP_LOCK
if this is the case I would release a bug fix version with some extra check on SKIP_LOCK to be on the save side
My war has META-INF/jruby.home/lib/ruby/shared/jar_dependencies.rb NOT stdlib:
(=2b07b) dgolombek@THQ_M_DGOLO02 ~/src/evergreen_topologies> jar tvf build/libs/evergreen_topologies-1.1.0-SNAPSHOT.jar |grep jar_dependencies.rb
9235 Thu Aug 20 12:02:24 EDT 2015 META-INF/jruby.home/lib/ruby/shared/jar_dependencies.rb
11852 Tue Dec 01 14:37:50 EST 2015 gems/jar-dependencies-0.3.0/lib/jar_dependencies.rb
12395 Fri May 13 11:38:38 EDT 2016 gems/jar-dependencies-0.3.2/lib/jar_dependencies.rb
12463 Fri May 13 11:16:52 EDT 2016 gems/jar-dependencies-0.3.3/lib/jar_dependencies.rb
Sure enough, no SKIP_LOCK inside that file:
unless defined? Jars::MAVEN_SETTINGS
MAVEN_SETTINGS = 'JARS_MAVEN_SETTINGS'.freeze
LOCAL_MAVEN_REPO = 'JARS_LOCAL_MAVEN_REPO'.freeze
# lock file to use
LOCK = 'JARS_LOCK'.freeze
# where the locally stored jars are search for or stored
HOME = 'JARS_HOME'.freeze
# skip the gem post install hook
SKIP = 'JARS_SKIP'.freeze
# do not require any jars if set to false
REQUIRE = 'JARS_REQUIRE'.freeze
# @private
NO_REQUIRE = 'JARS_NO_REQUIRE'.freeze
# no more warnings on conflict. this still requires jars but will
# not warn. it is needed to load jars from (default) gems which
# do contribute to any dependency manager (maven, gradle, jbundler)
QUIET = 'JARS_QUIET'.freeze
# show maven output
VERBOSE = 'JARS_VERBOSE'.freeze
# maven debug
DEBUG = 'JARS_DEBUG'.freeze
# vendor jars inside gem when installing gem
VENDOR = 'JARS_VENDOR'.freeze
# resolve jars from Jars.lock
RESOLVE = 'JARS_RESOLVE'.freeze
end
(=2b07b) dgolombek@THQ_M_DGOLO02 ~/src/evergreen_topologies> unzip -p build/libs/evergreen_topologies-1.1.0-SNAPSHOT.jar META-INF/jruby.home/lib/ruby/shared/jar_dependencies.rb | shasum bc887df0e3aeaa3eb8ae98cf87859637656cb7c9 - (=2b07b) dgolombek@THQ_M_DGOLO02 ~/src/evergreen_topologies> unzip -p build/libs/evergreen_topologies-1.1.0-SNAPSHOT.jar META-INF/jruby.home/lib/ruby/shared/jar_dependencies.rb | md5 df7d65ad7232a11aa4e88c57ce40395d
It looks like I'm getting jar-dependencies 0.1.15 from JRuby and 0.3.3 from Gradle
2b07b) dgolombek@THQ_M_DGOLO02 ~/src/evergreen_topologies> jar tvf build/libs/evergreen_topologies-1.1.0-SNAPSHOT.jar |grep jar-dependencies|grep gemspec
2181 Thu Aug 20 12:02:20 EDT 2015 META-INF/jruby.home/lib/ruby/gems/shared/specifications/default/jar-dependencies-0.1.15.gemspec
1575 Fri May 13 11:16:52 EDT 2016 gems/jar-dependencies-0.3.3/jar-dependencies.gemspec
1942 Fri May 13 11:16:52 EDT 2016 specifications/jar-dependencies-0.3.3.gemspec
0.1.15 rings a bell on the jruby-gradle-plugin as we found out there that this version is somehow hardcoded inside the plugin. so this gradle plugin could need a fix and release as well.
I will let you know once things are released. thanks for digging into this.
@dgolombek please try version 0.3.4 of jar-dependencies and if this works I go and see the gradle plugin ;)
Yep, 0.3.4 fixes the problem, thank you!
I'm building a jar with Gradle and jruby-gradle-storm-plugin and jruby-gradle-plugin. After Gradle upgraded itself to 2.2.1, Jars::SKIP_LOCK is no longer defined and jar-dependencies barfs every time it tries to load. I can't figure out where SKIP_LOCK is defined, but it's clear that whatever is defining Jars::MAVEN_SETTINGS is no longer defining Jars::SKIP_LOCK. If I change jar_dependencies.rb to not assume co-definition and check for definition of SKIP_LOCK on its own then things start working again. I know I'm missing a ton of details about exact versions -- I'm just not sure if Gradle+Maven jar versions are important or ruby gem versions are defining this. Please let me know what information I can provide to help debug.