Maven build not working. #108

LeifWarner opened this Issue Jun 5, 2012 · 5 comments


None yet
3 participants

jruby -S rake builds the thing just fine, though.
Any maven task I try fails on this part:
[INFO] --- jruby-rake-plugin:1.6.7:jruby (bundle-install) @ jruby-rack ---
[INFO] Fetching gem metadata from
[INFO] Gem::Exception: Cannot load gem at [file:/home/leif/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/cache/rake-] in /tmp/jruby-rack
[INFO] An error occured while installing rake (, and Bundler cannot continue.
[INFO] Make sure that gem install rake -v '' succeeds before bundling.

And yes, that command succeeds. I have tag 1.1.6 checked out.
Even though the rake task works for build, I would like to get maven working - I was hoping to published a hacked-up version of this jar to our own maven repo for us to use.

"gem env" lists $JRUBY_HOME/lib/ruby/gems/1.8 and $HOME/.gem/jruby/1.8
The only thing I have installed in the latter is bundler. The former is full of the rest of the stuff specified in Gemfile.lock. That path above is curious - wondering why it's trying to load rake out of the jruby jar, rather than the one in $JRUBY_HOME gems.


nicksieger commented Jun 6, 2012

I think I'm seeing a similar issue right now, due to the fact that $GEM_HOME is interpreted as being inside a jar file.

[WARNING] ERROR:  While executing gem ... (Gem::FilePermissionError)
[WARNING]     You don't have write permissions into the file:/Users/nicksieger/Projects/git/home/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/gems/1.8 directory.

Can you try the following in your project and post results here:

$ mvn org.jruby.plugins:jruby-rake-plugin:irb
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building JRuby-Rack
[INFO] ------------------------------------------------------------------------
[INFO] --- jruby-rake-plugin:1.6.7:irb (default-cli) @ jruby-rack ---
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> Gem.dir
=> "file:/Users/nicksieger/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/gems/1.8"
irb(main):003:0> Gem.path
=> ["file:/Users/nicksieger/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/gems/1.8", "/Users/nicksieger/.gem/jruby/1.8"]
irb(main):004:0> $LOAD_PATH
=> ["file:/Users/nicksieger/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8", "file:/Users/nicksieger/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared", "file:/Users/nicksieger/.m2/repository/org/jruby/jruby-complete/1.6.7/jruby-complete-1.6.7.jar!/META-INF/jruby.home/lib/ruby/1.8", "."]

The workaround to this is to do e.g. export GEM_HOME=~/.gem/jruby/1.8 in your environment to a directory before launching maven.

export GEM_HOME=/opt/jruby/lib/ruby/gems/1.8 seems to work for me. Should this be mentioned in the docs?

...but then it fails later with:

[WARNING] NameError: cannot link Java class org.jruby.rack.mock.MockServletContext, probable missing dependency: org/springframework/core/io/ResourceLoader
[WARNING]   get_proxy_or_package_under_package at org/jruby/javasupport/
[WARNING]                               (root) at /home/leif/Build/jruby-rack/src/spec/ruby/spec_helper.rb:153
[WARNING]                              require at org/jruby/
[WARNING]                               (root) at /home/leif/Build/jruby-rack/src/spec/ruby/spec_helper.rb:8
[WARNING]                                 load at org/jruby/
[WARNING]                      load_spec_files at /home/leif/Build/jruby-rack/src/spec/ruby/action_controller/session/java_servlet_store_spec.rb:780
[WARNING]                              collect at org/jruby/
[WARNING]                      load_spec_files at /opt/jruby/lib/ruby/gems/1.8/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780

trying to run some rspec tests, I imagine.
Even if I invoke it w/
mvn package -DskipTests


kares commented Nov 7, 2012

that is very weird - can not reproduce ... but here's how you skip specs : mvn package -Dmaven.test.skip=true

@kares kares closed this Feb 25, 2014

@kares kares added the invalid label Feb 25, 2014

kares added a commit that referenced this issue Mar 6, 2014

start using de.saumya.mojo jruby plugins for mvn (relates to #108 as …

this allows us to work without a GEM_HOME/GEM_PATH (local ruby install)

@kares kares removed the invalid label Mar 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment