Github authentication: how to use Github as Maven repo when repo is private
I'm trying to store some of our private artifacts on Github and would like to access them as if they were part of a Maven repo. There are lots of pages that explain how to create a public Maven repo on Github: you just put the artifacts in the proper directory structure in your project, and then access them using a "raw" URL: <repositories> <repository> <id>myrepo.myname.github.com</id> <url>https://github.com/myname/myproject/raw/master/repositories/releases/</url> </repository> </repositories> So far, so good. Now the trouble is that I can't figure out how to access the repo if it's private. I've added a username and password to my settings.xml, but it doesn't work: <servers> <server> <id>myrepo.myname.github.com</id> <username>myusername</username> <password>mypassword</password> </server> </servers> What's the trick?
The question is now moot. Github has eliminated downloads. They don't host binaries any more. Probably because of exactly the kind of abuse I've proposed...
I've never done this either. But github allows ssh/key authentication, that may work? <servers> <server> <username/> <password/> <privateKey/> <passphrase/> <filePermissions/> <directoryPermissions/> <configuration/> <id/> </server> </servers> On GitHub you can add the key (at least it looks like if it is possible) to that repository (Repository -> Admin -> Deploy Keys): https://help.github.com/articles/managing-deploy-keys I've used ssh to deploy artifacts on a linux server a few years ago before we installed a repository proxy. That was a bit tricky to setup on the client (trusted keys and so on) but it worked nicely. I remember you needed to execute a mvn deploy manually for the first time to add the server key/fingerprint locally before this could be done automatically by a script or CI server.
You can access private repositories from Maven pom.xml using the following URL: https://api.github.com/users/username/repos?login=username&token=oauthtoken&repositoryname=reponame
Cucumber Rerun failed features : Inconsistent filters: [#test1, #test, 23, 36]. Only one type [line,name,tag] can be used at once
Creating an external Maven packaging POM
How to Integrate BIRT Chart Engine 4.6.0 into maven project
Maven dependency plugin downloads POM instead of tar.gz
Maven get from Wrong repository
Artifactory Dependency Declaration does not match maven-metadata.xml or pom
Jenkins is not showing all executed Tests / Test Results in Build Overview
jBCrypt dependency not working
Maven not importing External Library into project after adding to .pom file in Intellij
docker-maven-plugin build assembly fail
Maven - How to override version?
Dependencies and Repositories?
DriverManager.getConnection never been executen in my maven project
Maven projects - how to read a property that is defined in the pom file of a project that is added as a dependency
Travis CI: Maven fails to get Kotlin 1.1.1 dependency on Linux
How to tell versions-maven plugin to act on non-child modules?