Publishing to GitLab Maven Repo

I am trying to publish an artefact to my gitlab repo using gradle.

publishing {
  publications {
    maven(MavenPublication) {
      groupId 'com.example'
      artifactId 'example'
      version '1.0.0'
      artifact buildJar
    }
  }
  
  repositories {
    maven {
      url 'git@gitlab.com:username/my-repo.git'
    }
  }
}

But I am getting a Received status code 404 from server: Not Found error message.

Is it possible to do that? How about authentication?

1 Like

Are you able to publish on Gitlab, as I also need the same. Looking forward to your positive reponse