How to add Github raw repositories to Sonatype Nex

2019-05-08 18:47发布

问题:

Nowadays there are a lot of github hosted Maven repositories. ex) https://github.com/nhnopensource/nhnopensource.maven.repo

I tried to add those repositories into my Sonatype Nexus repository manager as proxy repository, but failed all the time.

But the repositories work fine when I set repository url directly to the github repositories in gradle/maven configuration.

Has anybody succeeded to add github hosted maven repository into Nexus?

回答1:

I found the solution : https://github.com/sagemintblue/sagemintblue-repositories

If you use Sonatype's Nexus repository manager, you may want to add proxy entries to your Nexus configuration for the Sagemintblue repositories. Here are a few notes to keep in mind:

Sagemintblue repositories don't contain indices. You should set Remote Repository Access > Download Remote Indexes to false.

Because GitHub doesn't generate directory listings for raw repository directory URLs, Nexus will automatically block the proxied repositories if Remote Repository Access > Auto blocking active is set to true. Set this option to false and click Refresh. You should see a Repository Status of Attempting to Proxy and Remote Unavailable. Nexus should still be able to access specific artifact, pom and checksum file URLs despite the missing directory listings.



回答2:

I think the problem with this repo may be that it doesn't have index.html, and so Nexus cannot "crawl" it... I'm not 100% sure, but I remember having encountered something similar when I set-up my own https://github.com/vorburger/m2p2-repository. If that's not it, try posting on nexus-user@sonatype.org and when you've figured it out post the correct response here! ;-) PS: http://blog2.vorburger.ch/2013/08/deploying-github-hosted-maven-incl.html may also be of interest to you?