Jitpack.io: how to proxy jitpack.io through nexus

Created on 31 Mar 2016  路  10Comments  路  Source: jitpack/jitpack.io

we run a private nexus repository at work and proxy maven central, etc. i'm not having any lucky setting up a proxy and was hoping you could provide the correct configuration settings.

thanks!!

Most helpful comment

I have a similar situation at work, the following lines in my settings.xml fixed it for me:

        <mirror>
            <id>COMPANY-nexus</id>
            <mirrorOf>*,!jitpack.io</mirrorOf>
            <url>COMPANY MIRROR</url>
        </mirror>
        <mirror>
            <id>jitpack.io</id>
            <mirrorOf>jitpack.io</mirrorOf>
            <url>https://jitpack.io</url>
        </mirror>

All 10 comments

I have a similar situation at work, the following lines in my settings.xml fixed it for me:

        <mirror>
            <id>COMPANY-nexus</id>
            <mirrorOf>*,!jitpack.io</mirrorOf>
            <url>COMPANY MIRROR</url>
        </mirror>
        <mirror>
            <id>jitpack.io</id>
            <mirrorOf>jitpack.io</mirrorOf>
            <url>https://jitpack.io</url>
        </mirror>

I've run into the same issue. I'm suspecting the problem is that jitpack does not allow indexing of it's build artifacts.

Any progress on this?

It's true that jitpack doesn't publish an index though not sure why that would prevent proxying.
There are some settings.xml changes mentioned earlier. Do those help at all?

if you're trying to mirror through nexus, there is an option to turn off generating the remote index. i have to do that in order to mirror one of adobe's sites.

The fix for the settings.xml does indeed work. however that just circumvents our company's nexus altogether.

Nexus does seem to create an index and if it does not have one does not seem to look for any artifacts for that repo. I will try to find the option to disable the remote index as @jgangemi suggested. However we are running an old version of Nexus, so I have to see if it supports that.

Thanks for your suggestions so far.

OK I've tried to turn off indexing. But Nexus is still refusing to talk to jitpack.io. When I save the configuration it tries do communicate with jitpack.io but encounters some error. No idea which since it's HTTPS. And Nexus does not show a warning or error anywhere.
Whenever I try to get the dependency from Nexus no further communication between Nexus and jitpack.io happens.

Same Problem here... no luck proxying jitpack via Nexus.
The most convenient solution i found , which is just a tuned version of the above mentioned which bypasses nexus, is to exclude jitpack.io from the main mirror.

  <mirror>
    <id>nexus</id>
    <mirrorOf>*,!jitpack.io</mirrorOf>
    <url>http://company.com/nexus</url>
  </mirror>

And to create a profile which is added to the active profiles. This way you only have to put the desired dependencies into your pom and omit the repository declaration.

  <profile>
    <id>jitpack</id>
    <repositories>
      <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
      </repository>
    </repositories>
  </profile>

  <activeProfiles>
       <activeProfile>jitpack</activeProfile>
  </activeProfiles>

Hi all,

We've deployed a fix that should solve proxying via Nexus: https://issues.sonatype.org/browse/NEXUS-9890

Tested using Nexus 2 and 3.

To proxy JitPack:

  1. Add https://jitpack.io as a new maven2 (proxy) repository in Nexus (example)
  2. Add that repository to Maven-public group (example)

Let us know if you still experience any issues.

image

Just wanted to say that @saulvargas answer for settings.xml is still relevant and useful, and that's what I came here for.

@jitpack-io's answer (https://github.com/jitpack/jitpack.io/issues/506#issuecomment-267338823) worked for us using Nexus 3.15.

Was this page helpful?
0 / 5 - 0 ratings