java - Host private maven artifact in github repository -
i using following solution hosting maven repository on github host private maven repository on github
i have managed deploy maven artifact github repository under mvn-repo branch.
the thing having hard time use artifact maven dependency in other project. have added repository settings in 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 settings.xml file
<server> <id>github</id> <username>{github-user-name}</username> <password>{github-user-password}</password> </server> and when try install project errors on artifact cannot found , when set artifact github repository public repository works great authentication problem. , weird thing used same credentials in order deploy artifact in first step same github repository success.
i tried use "personal access tokens" concept generating access token github , using in settings.xml below:
<server> <id>github</id> <password>{personal_access_token}}</password> </server> but without success... half way there have managed create maven artifact in github repository can distributed need private repository.
anyone can , answer highly appreciated.
this cannot done using maven alone, raw.github.com expects access token @ end of url when accessing private repository, there no option in maven supply token.
alternate ways
supplying users install script
you can supply users kind of installer script downloads dependencies , installs them local maven repository. can install jars locally using:
mvn install:install-file -dfile=<path-to-file> -dpomfile=<path-to-pomfile> your installer should should bundle few of commands want.
related: guide installing 3rd party jars
hosting own maven dependency server
you don't need quick computer host dependencies maven projects, had raspberry pi in past, used nginx sendfile option performance static document server, remember maven optimalized local content, downloads file 1 , switches local file remaining time.
disclaimer: not affiliated raspberry pi company.
Comments
Post a Comment