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
Alternative place to specify mvn --fail-at-end command line option?
Maven - Not able to open jars it is downloading
Deploy p2 repo to Nexus
System.Diagnostics.Debug.WriteLine() Does Not Work Under NUnit Console
how to use maven with intellij 13
Automatically download missing artifacts if missing in Artifactory
How to package up a leiningen project for recompilation with all the libraries included? [for users without an internet connection]
How to fail when maven profile does not exist?
Sharing dependencies not in central repo with the project
license issue in mule when building with junit test cases
Change Maven repository that NetBeans uses
Maven release-plugin doesn't update LATEST version
How to configure pom.xml so deploy custom artifact to remote repo (archiva)
Making sure all dependency versions are specified in dependencyManagement in maven
How to update archetype-catalog in Nexus repository
deployment of an ejb maven project from eclipse