Resolving Maven Dependency from Github Private Refile

We have a JAVA library in our private github repository. We want to include this library in other JAVA projects as a maven dependency. I am looking for a way to successfully host the maven repository in my private github registry.

I can successfully place a repository maven, following these steps here . However, I cannot link this repo as a dependency in my other projects.

In an answer to another question here, someone mentioned that this is not possible. But I can point to this repo when I do this public repo. This leads me to believe that maven is not using the credentials provided in ~/.m2/settings.xml

dependency resolution.

I also believe that github does not support downloading binaries hosted in a private repo using basic HTTP authentication. Although I can successfully do

curl -uazitabh https://github.com/azitabh/test/raw/mvn-repo/test-1/test-1/0.0.11/test-1-0.0.11.jar

      

Doing the following results in {"error":"Not Found"}

curl -uazitabh https://github.com/ANOTHER-USER/test/raw/mvn-repo/test-1/test-1/0.0.11/test-1-0.0.11.jar

      

The permissions are ok as I can download the jar file very well using the same link in the browser when I logged in.

How do I get the dependency resolution bit?

+3


source to share





All Articles