Bundler+Maven workaround

Friday, September 30, 2011

I started a proper integration of Bundler and MavenGem several months ago. But it still has many quirks that I haven't been able to resolve. The reason I haven't bothered to finish it out is that the workaround is pretty simple. Let me show you.

Lets say you have a Gemfile like this:


If you run 'bundle install' you'll get this error: "Could not find mvn:rhino:js-1.7.r.2-java in any of the sources"

But Bundler will be happy if you install the Gem locally first. So in my projects, I usually include a 'setup.sh' at the root level that installs all my MavenGems the "old fashion way."


Then I just make sure this is run the first time anyone working on the project checks it out. You can also move this into a rake task if you'd like.

Its a pretty nice workaround because your build will simply fail if you don't run the setup.sh. And you only have to do that once. So as long as you are aware of the step, its just like 'rake db:create' or something.

A side-project I'm considering is some task/script/voodoo that reads a Gemfile, finds the MavenGem dependencies, and installs them locally for you. Let me know if you interested - it would only take a half a day to make.

Cheers,

Joe




© 2005 Joe Kutner.