Uploading package to GitLab Maven Repository trough Sbt

I am working with a fresh trial of GitLab 13.0.6-ee installed via docker-compose. I would like to investigate the usage of GitLab Package Registry in our projects. Especially the support for Maven artifacts, Npm libraries and containers images.

I can see that my registry is empty via the “Packages & Registries” menu entry. So, I assume that the registry is enabled.

Because this is my main concern, I have tried to upload a package trough Sbt. But I cannot manage to have it working.

I have created a “deploy key” for my project and configured the repository but the publication fail:

credentials += Credentials(
    "GitLab repository",
publishTo := Some(
    "GitLab repository" at 

[error] (publish) java.io.IOException: Access to URL http://localhost/api/v4/projects/2/packages/maven/default/infrastructure_2.12/0.1.0-SNAPSHOT/infrastructure_2.12-0.1.0-SNAPSHOT.pom was refused by the server: Unauthorized; Response Body: {“message”:“401 Unauthorized”}

Please note that when I create the token, I can only see and select the “read_repository” scope.

  • Do you have succesfully published a maven artifact trough Sbt ?

I guess I should configure the Http headers with Sbt but have no idea on how to do it.

  • Why can’t I select the write scopes ?

Is there some requirements or specific configurations to have the write scopes in a registry ?


Go to Source
Author: gervais.b