Scala Packages Hosted With Github
April 17, 2023

Scala Packages Hosted With Github

Posted on April 17, 2023

If you want Github to host your Scala packages in a public Maven repository, it basically four easy steps. I have an example repo at, but it’s …


  1. Get token from GitHub
  2. Apply to SBT settings for SBT plugin
  3. compile and publish
  4. Usage package in your other project, add it you your build.sbt

Get token from GitHub

  • Generate a token for GitHub, navigate to Settings > Developer Settings > Personal access token > Token (classic) > “Generate new token” button
  • Select the permission options
  • Select how long this token will be vaild before having to generate a new one

GitHub Settings

Add GitHub token to your credentials

  • Add your new Credentials to this file: $HOME/.sbt/1.0/github.sbt
credentials += 
    "GitHub Package Registry",

Install the SBTplugin

Publish a package to GitHub Maven

  • sbtn publish

Use your Scala package in other projects

  • build.sbt, use an externalResolvers to look at your package on GitHub
externalResolvers += "ScalaLibrary packages" at ""

lazy val root = project
    name                                   := "scala-3-workspace",
    version                                := "0.1.0-SNAPSHOT",
    scalaVersion                           := "3.2.2",
    libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test,
    libraryDependencies += "com.kyledinh" %% "scala-library_3" % "0.1.0-SNAPSHOT"

That’s it, Folks!


I learned from this article, by Manuel Rodriguez: [](, then updated to the current Scala3, SBT plugin and verison.