maven


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

Related Links

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

Categories

HOME
bluetooth
google-docs
setup-deployment
analysis
electronics
cakephp-2.5
umd
yum
adobe-analytics
row
google-apps-marketplace
remote-access
carthage
lombok
foselasticabundle
graphlab
jprofiler
conemu
ml
mustache.php
trading
java-7
underflow
filezilla
.net-4.0
language-concepts
normal-distribution
revolution-slider
swift3.0.2
webix-treetable
ssjs
acoustics
pubmed
promela
jlink
media-player
account-kit
google-cdn
log4c
ctest
markojs
skype4py
bgp
cloudbees
ios8-today-widget
lib.web.mvc
muse
0xdbe
ionic
arcanist
cisco-ios
ami
oberon
p2
streambase
facebook-graph-api-v2.4
knuth
applescript-objc
googlemock
mesa
ceil
mysql-error-1062
inbox
spring-io
google-cloud-save
seed
sqlperformance
hamiltonian-cycle
mt
broken-links
chrono
netbeans-6.9
buildr
xmlspy
tomcat-valve
django-tagging
actionview
radcombobox
gamma
forums
rescale
meego
compiler-specific
pascal-fc
port-number
msdev
mdac
ntvdm.exe

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App