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

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?

Categories

HOME
omnet++
heroku
drivers
alfresco
sqlite-net-extensions
frameworks
retrofit
datastax-java-driver
slick-slider
handsontable
u-sql
modelica
windows-azure-storage
usergrid
messages
ibm-odm
clearcase-ucm
connection-string
firefox-webextensions
custom-wordpress-pages
reverse-proxy
clickonce
captiveportal
lcd
icloud-api
numerical-methods
javacv
wpfdatagrid
uninstall
assistant
facebook-apps
libssl
quote
gsmcomm
fabric8
galsim
xquery-3.0
exuberant-ctags
catel
winrt-xaml-toolkit
caret
openoffice.org
wallpaper
mmenu
host
restlet
az-application-insights
unobtrusive-validation
trim
ensembles
dynamic-reports
fakeiteasy
mime
unixodbc
modelmapper
youcompleteme
strptime
qsslsocket
theming
typescript1.8
yii2-extension
kbuild
nodebb
sqldf
topbeat
xcb
visual-c++-2008
nxt
skobbler-maps
markojs
qgraphicsview
system.management
natvis
ios8-today-widget
security-testing
rgeo
apache-commons-fileupload
fluid-dynamics
generic-programming
angular-local-storage
skos
jsapi
modalpopup
typekit
android-imagebutton
uitouch
algebraic-data-types
srs
apc
ril
file-locking
jplaton
delphi-6
jquery-knob
newtonscript
errai
jspinclude
windows-phone-7.1.1
ohm
assembly-loading
boost-filesystem
php-parser
xmlspy
xtype
yetanotherforum
appender
self-extracting
locate
visitor-statistic
cxxtest
audio-capture
yagni
ugc
multiple-languages
django-notification
document-conversion
uiq3

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