Closed jsvd closed 8 years ago
I am not sure if this related: https://github.com/jruby/jruby/issues/3676 jar-dependencies installs the right right ruby-maven gem if not available but with jruby-9.0.5.0 this does not work, as the one bundled with jruby is NOT the right one for jar-dependencies and the installed one is not used.
does jruby-9.0.4.0 works for you ? if not then there is some other issue going on here, why the ruby DSL for poms gets not activated.
@mkristian jruby 9.0.4.0 works for me, but 9.0.5.0 throws the above
It seems 9.0.5.0 started using 0.2.x instead of 0.1.x
% git diff 9.0.4.0 9.0.5.0 -S jar-dependencies --name-status
M lib/pom.rb
M lib/pom.xml
M pom.rb
M pom.xml
% git diff 9.0.4.0 9.0.5.0 | grep jar-dependencies
- ImportedGem.new( 'jar-dependencies', '0.1.15', true ),
+ ImportedGem.new( 'jar-dependencies', '${jar-dependencies.version}' ),
<artifactId>jar-dependencies</artifactId>
+ <version>${jar-dependencies.version}</version>
+ 'jar-dependencies.version' => '0.2.3',
+ <jar-dependencies.version>0.2.3</jar-dependencies.version>
@jsvd if 9.0.4.0 works for you means the version of jar-dependencies coming with jruby-9.0.5.0 does not work. picking jar-dependencies-0.1.15 will work as well.
or using RVM which installs jruby-9.0.5.0 from source distribution (did not verify this though). the binary distribution of jruby-9.0.5.0 is broken as it forces it preinstalled ruby-maven and there is no way sane way around this.
will be fixed for next jruby version : 9.1.0.0
digging a bit more, I'm not sure it's a problem with the packaged version of jar-dependencies, as the bootstrap scripts in logstash update all gems before executing the other setup tasks. So while 9.0.5.0 ships with jar-dependencies 0.2.3, it generates an error from 0.3.2 (as shown in the log).
I've checked that when using either jruby .4 or .5, the versions are the same for jar-dependencies and ruby-maven:
the problem are not the installed gems but the ruby-maven from $JRUBY_HOME/lib/ruby/stdlib which contains the ruby-maven files.
ruby -e 'require "ruby_maven";p Gem.loaded_specs'
which gives for jruby-9.0.4.0
{"ruby-maven-libs"=>#<Gem::Specification:0x7d2 ruby-maven-libs-3.3.3>, "ruby-maven"=>#<Gem::Specification:0x7d4 ruby-maven-3.3.8>}
and for 9.0.50
{}
so with 9.0.5.0 you can use any ruby-maven gem, it ALWAYS will use the ruby-maven from $JRUBY_HOME/lib/ruby/stdlib
I see. so the fix is in 9.1? if so this can be closed. I've tried to test the latest 9.1 snapshot but it is crashing for me.
let me quickly push the fix on jruby master :) - did not do it since travis is too red for me as occasional committer - but it should be safe to do
@jsvd fixed on jruby master. not sure I can trigger a new snapshot build
@mkristian no worries. thanks for the awesome feedback and quick fix <3
@mkristian unfortunately I'm still having this issue in jruby 1.7.24 https://github.com/elastic/logstash/issues/4818 This seems related to https://github.com/mkristian/jar-dependencies/issues/25 although I see no failed loading of jars when enabling debug. see output of the maven command in https://gist.github.com/jsvd/758e3d4beefcf035d051
when executing usual bootstrap tasks in logstash, if I switch to jruby 9k I'm getting:
It seems the gemspec_pom.rb isn't being evaluated at all but read AS-IS. if I remove the comment line from the rb file I get an error at the first code letter of the first eval statement in gemspec_pom.rb:
org.apache.maven.model.io.ModelParseException: only whitespace content allowed before start tag and not e (position: START_DOCUMENT seen e... @1:1)