Closed ddossot closed 10 years ago
well, that is quite a difficult one since it needs to be addressed before maven starts resolving the gem artifacts - and there is no hook for it in maven itself (as far I understand things). ruby-maven does have natural hook - it first starts Ruby ;)
so I think something can be done using the bundler API to get most pom.xml (reduced to only dependencies) in place before regular maven starts.
beside that I just can repeat what I wrote the other day https://github.com/torquebox/jruby-maven-plugins/issues/57#issuecomment-46668167
OK, thanks again for your time and answer. Sorry for not having found the other issue, I could have just commented on it.
I guess I got confused when I saw that the POM was correct, with strict versions defined ; and that the ranged dependencies were in a specific and inactive profile. I was expecting that because the active dependencies in the POM only contained strict versions for the Gems, and because the project has a Gemfile.lock
pre-computed by bundler, the logic for ranged versions would not kick in.
Oh well, better not blow up that Maven repo then :sweat_smile:
maybe I could just use the Gemfile.lock as is to setup the gems and attach them to maven project without the need to declare them as gem artifacts inside the POM but resolve them without there "transitive dependencies"
let's see if that is possible, at least it would meet maven and bundler on middle ground.
That would be awesome :smile:
I do realize that it's hard to accommodate all these different workflows that crazy devs are setting up with your tools :blush: On our side, we build Ruby modules for Vert.x: our Ruby devs do everything with Bundler+Rake then our continuous integration assembles the module with ruby-maven. That's why we have this environment where Bundler has resolved all the dependency versions in a Gemfile.lock and ruby-maven is expected to pick-it up...
Anyway, thanks again for your assistance.
https://github.com/torquebox/jruby-maven-plugins/issues/57#issuecomment-46668167
that first step was easy ;)
now I have to fix ruby-maven and make sure the "none" profile gem artifacts are not declared - thanx for pointing that fact out. it looks like ruby-maven starts to play well with bundler now ;)
:thumbsup:
it relased it: ruby-maven-3.1.1.0.7
BTW the reduced traffic is very helpful and actually made things like this possible/feasible:
https://github.com/jruby/jruby/wiki/Rack-Application-with-JBundler-on-Heroku https://github.com/jruby/jruby/wiki/Running-Minitest-or-Rspec-over-serveral-JRuby-versions-with-Ruby-Maven
Happy to confirm this works perfectly, thank you so much!
We're facing a strange situation :sweat:
We have a bundler generated
Gemfile.lock
and aruby-maven
build that uses aMavenfile
, which in essence refers to a parentpom
and contains thegemfile
directive. The parentpom
configures thegem-maven-plugin
as such:When building with
rmvn
, each version of each gem is downloaded as if theGemfile.lock
didn't exist, which literally takes hours.If I run
rmvn help:effective-pom
, I see that the gems appear three times:gemfile
profile with ranges, which activates if theGemfile.lock
file doesn't exist.gemfile_lock
profile with fixed versions, which activates if theGemfile.lock
file does exist.All this looks nice and correct so I can not understand why I still see all the versions downloaded.
I even tried
-Pgemfile_lock,-gemfile
to forcefully enable/disable the profiles, but to no avail.Any light you could shed on the problem would be really appreciated. Thank you.