Gradle add dependency from Gitlab private repository


I followed the steps in this link Maven packages in the Package Repository | GitLab
I was able to create a jar file and push it, I also can see it in my project Package Registry.

When I try to add the dependency in another project just like the document says, gradle finds the package but doesn’t download the jar file. It downloads .pom file and .module file but never jar file and hence the project can’t see the library classes.

In my build.gradle I use:

repositories {

maven {
    url ""
    credentials(HttpHeaderCredentials) {
        name = 'Private-Token'
        value = gitLabPrivateToken
    authentication {


dependencies {
implementation ‘com.apptcom.kidstar:kidstar-library:0.0.10’