Can't publish artifact to Github


#1

I want to exploit github as private maven repo for personal use. However, when publishing packaged artifact sbt complains

java.io.IOException: Access to URL ... was refused by the server: Forbidden

My build.sbt content

publishTo := Some("Github Repo" at "https://github.com/myaccount/mvn-repo")
credentials += Credentials("Github Repo Manager", "host", "user", "pass")

Searching on the internet and scala user forum do not find solution. How can I publish artifact jar file to github using SBT?

Thanks


#2

Could that be because GitHub is not an artefact repository?


#3

I think so. But seemingly it’s doable because I find some people use it that way

https://janzhou.org/2015/10/29/use-sbt-and-git-to-create-your-own-maven-repository.html

But it’s not clear how it’s done as the article only mentions local repos which always works without a problem.

If following that article to use github’s githubusercontent

publishTo := Some("Githut Release" at "https://raw.githubusercontent.com/<account>/<project-name>/release")

sbt complains java.io.IOException: PUT operation to URL ... failed with status code 400: Bad Request


#4

They just make remote copies of their local artefact repo by putting it
inside a Git repo and then make remote copies of the Git repo with the
artefact repo inside to be used locally.

This is different from having a remote artefact server.


#5

Easiest is to use bintray but if you need private, you can use Amazon S3
(needs an sbt plugin)