Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven build not working. #108

Closed
LeifWarner opened this issue Jun 5, 2012 · 5 comments
Closed

Maven build not working. #108

LeifWarner opened this issue Jun 5, 2012 · 5 comments

Comments

@LeifWarner
Copy link

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 http://rubygems.org/...........
[INFO]
[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-0.9.2.2.gem] in /tmp/jruby-rack
[INFO] An error occured while installing rake (0.9.2.2), and Bundler cannot continue.
[INFO] Make sure that gem install rake -v '0.9.2.2' 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.

@LeifWarner
Copy link
Author

"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
Copy link
Member

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] ------------------------------------------------------------------------
[INFO] Building JRuby-Rack 1.1.7.dev-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[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.

@LeifWarner
Copy link
Author

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

@LeifWarner
Copy link
Author

...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/JavaUtilities.java:54
[WARNING]                               (root) at /home/leif/Build/jruby-rack/src/spec/ruby/spec_helper.rb:153
[WARNING]                              require at org/jruby/RubyKernel.java:1062
[WARNING]                               (root) at /home/leif/Build/jruby-rack/src/spec/ruby/spec_helper.rb:8
[WARNING]                                 load at org/jruby/RubyKernel.java:1087
[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/RubyArray.java:2339
[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
Copy link
Member

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 as completed Feb 25, 2014
@kares kares added the invalid label Feb 25, 2014
kares added a commit that referenced this issue Mar 6, 2014
…well)

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants