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

jar dependencies like old maven-gems #1451

Closed
wants to merge 4 commits into from
Closed

Conversation

mkristian
Copy link
Member

this PR is meant to base for further discussion.

previously maven-gems failed mainly version resolution with maven (on version conflict the dependency tree is used to determine the right version) works totally different then rubygems (version ranges).

this patch has two parts one which loads jars and tracks versions. in case of conflicting versions ONLY the first jar is loaded and the second one just gives a warning. kind of the same you have with rubygems where it fails when a second version of a gems gets activated.

the second part is a Gem.post_install hook which uses the info from the installed Gem::Sepcification of the installed gem and looks for jar dependencies declared in the requirements section of the spec. these declared jars and its depencenies will be install using ruby-maven (which can uses the gemspec as a POM !!). it also creates a file {gemspec.name}_jars.rb file which uses the jar_dependencies to track and load the vendored jars.

to main reason to vendor the jars is that regular bundler will just work.

in case there are version conflicts jbundler can help to resolve them or do it manually. it is a matter of which version gets required first, any project should be able to ensure this.

as an example I added the jar dependencies in jruby-openssl gem.

@mkristian
Copy link
Member Author

walkthrough the example gem. you need ruby-maven installed (might need the latest version):

 cd maven/gems/jruby-openssl
 ../../../bin/jruby -S rake build
 ../../../bin/jruby -S gem install pkg/jruby-openssl-0.9.5.gem 

@kares
Copy link
Member

kares commented Sep 1, 2014

this seems obsolete by now ...

@mkristian
Copy link
Member Author

yes, that is obsolete now . . .

@mkristian mkristian closed this Sep 4, 2014
@headius headius modified the milestone: Invalid or Duplicate May 4, 2015
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

Successfully merging this pull request may close these issues.

3 participants