Coder Social home page Coder Social logo

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) about jruby-gradle-plugin HOT 4 OPEN

tkrah avatar tkrah commented on July 30, 2024
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)

from jruby-gradle-plugin.

Comments (4)

tkrah avatar tkrah commented on July 30, 2024

Some debugging revealed some interesting things - the actual request made is e.g.:

https://tkrah:[email protected]/api/v1/versions/colorize.json

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

applyAuth(requestBuilder, chainedConfig);

which has this:

    private static void applyAuth(final Request.Builder requestBuilder, final ChainedHttpConfig chainedConfig) {
        final HttpConfig.Auth auth = chainedConfig.getChainedRequest().actualAuth();
        if (auth != null) {
            switch (auth.getAuthType()) {
                case BASIC:
                    requestBuilder.addHeader("Authorization", Credentials.basic(auth.getUser(), auth.getPassword()));
                    break;
                case DIGEST:
                    // supported in constructor with an interceptor
            }
        }
    }

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.

from jruby-gradle-plugin.

silverhammermba avatar silverhammermba commented on July 30, 2024

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 ruby.gems() repository, but I can't find a way to tell it to use my artifactory instance instead.

Using bundler, I changed my Gemfile from source "https://rubygems.org" to source "https://myartifactory.jfrog.io/artifactory/api/gems/gems/" and stored my credentials in an environment variable

export BUNDLE_MYARTIFACTORY__JFROG__IO="user:pwd"

and that works great for bundler. I tried doing the obvious thing similar to @tkrah and changing the repo to ruby.gems("https://user:[email protected]/artifactory/api/gems/gems") but that fails to resolve with a similar error

404 client error for request to /rubygems/twine/1.1.1/ivy.xml

> Task :myproj:jrubyPrepare FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':myproj:jrubyPrepare'.
> Could not resolve all dependencies for configuration ':myproj:gems'.
   > Could not find rubygems:twine:1.1.1.
     Searched in the following locations:
       - http://localhost:61344/rubygems/twine/1.1.1/ivy.xml
       - https://myartifactory.jfrog.io/artifactory/libs-release/rubygems/twine/1.1.1/twine-1.1.1.pom
     Required by:
         project :myproj

from jruby-gradle-plugin.

silverhammermba avatar silverhammermba commented on July 30, 2024

I think the fact that it searched http://localhost:61344/rubygems/twine/1.1.1/ivy.xml is promising, because that's the internal ivy proxy that the jruby plugin sets up. The annoying part is I can't find any way to see how that proxy is trying to resolve my custom URI. So it's hard to debug.

from jruby-gradle-plugin.

tkrah avatar tkrah commented on July 30, 2024

@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.

from jruby-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.