-
Notifications
You must be signed in to change notification settings - Fork 38
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
Custom gem repository not working with jruby-gradle-plugin 2.0.1 (plain command line gem does work with the same custom repo in .gemrc) #429
Comments
Some debugging revealed some interesting things - the actual request made is e.g.:
This won't work - the repository does not run under that URL - it's missing the whole part about the gem-repos url part: /artifactory/api/gems/gems-repos/ Additionally the OkHttpBuilder has a auth part called
which has this:
but authentication was not configured for that request (although it's included in the configured URL) - not sure if it will be respected or not, can't tell for sure because the whole URL does not match the configured one. Maybe someone has an idea what's wrong. |
I have this problem as well. I'm using this plugin to run a Ruby script (with gems) as part of my gradle build. Everything works fine if I use the default Using bundler, I changed my Gemfile from
and that works great for bundler. I tried doing the obvious thing similar to @tkrah and changing the repo to
|
I think the fact that it searched |
@silverhammermba look at #429 (comment) - I've debugged through the code - the whole url resolution is wrong if you specify a custom repository and auth is unconfigured. |
As far as I can tell, this fails because the authentication is never configured here: Lines 167 to 175 in 024713c
I believe fixing this would require either parsing the credentials out of the URI, or providing them from an external file or environment variable (I would probably allow for all 3 options) in the two DefaultRubyGemRestApi constructors, and creating a new function signature like this:
The constructors would call this signature is authentication was provided. There's probably a cleaner way to fix this, but that's the first way I could think of. |
Hi,
I tried to get a custom gem repository working with jRuby but it does not work like described.
I did configure my local .gemrc with that URL which it should use (custom mirror - artifactory) and it works just fine with "gem install ..." etc. - so the upstream mirror is ok.
I choose to modify the example from the project:
https://github.com/jruby-gradle/jruby-gradle-plugin/tree/master/examples/run-script-with-jruby-args
and modified the repository line from
ruby.gems()
to
ruby.gems("https://tkrah:[email protected]/artifactory/api/gems/gems-repos/")
Running the gradle task runGradleTest now just results in this output instead of a successful build:
So how do you use a custom repository with jRuby gradle plugin here? Just using the same URL which does work for command line running gem is not going to work here.
The text was updated successfully, but these errors were encountered: