I am using the following solution Hosting a Maven repository on github to host private maven repository on github
I have managed to deploy the maven artifact to the github repository under the mvn-repo branch.
The thing is that I am having hard time to use this artifact as maven dependency in other project. I have added the repository settings in the dependent pom.xml
<repository>
<id>github</id>
<name>{name}</name>
<url>https://raw.github.com/{repo-owner}/{repo-name}/mvn-repo/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
I have configured the settings.xml file
<server>
<id>github</id>
<username>{github-user-name}</username>
<password>{github-user-password}</password>
</server>
And when I try to install the project I get errors on artifact cannot be found , when I set the artifact github repository to be a public repository everything works great so obviously it is a authentication problem. and the weird thing is I used the same credentials in order to deploy the artifact in the first step to the same github repository with success.
I also tried to use "Personal access tokens" concept by generating access token from github and using it in the settings.xml as below:
<server>
<id>github</id>
<password>{personal_access_token}}</password>
</server>
But without success... so basically I am a half way there I have managed to create maven artifact in github repository which can be distributed but I need it to be private repository.
Anyone can help with that , your answer is highly appreciated.