Using multiple Gitlab registries in single Gradle file

134 Views Asked by At

I need to include 3 Maven packages from Gitlab in a gradle.build, but I'm stumbling somewhere. I know the packages are accessible, because other projects have been able to access them individually. However, when I try this new setup with any or all of the packages it fails with

Could not find yourProject.jar (com.group.path:yourProject:0.0.0-RELEASE). Searched in the following locations: <URL that totally works when I navigate to it or ping it with curl and the same Private-token the project uses>

All three repo includes take the form:

maven {
        name 'project-name'
        url 'https://gitlab.com/api/v4/projects/PROJECT_ID/packages/maven'
        credentials(HttpHeaderCredentials) {
            name = 'Private-Token'
            value = System.getenv("ENV_VAR")
        }
        authentication {
            header(HttpHeaderAuthentication)
        }
    }

I have tried this so many different ways and can't seem to get any of them to resolve when there's more than one. The ENV_VAR is resolving just fine, the endpoints are all accessible. I'm losing my mind. I've tried using the instance-level endpoint, but that seems to cause more issues since we're hosted at gitlab.com with a multipart group url and there doesn't seem to be a format for that case.

1

There are 1 best solutions below

0
withoutIf On BEST ANSWER

Okay. Well. I noticed that this was the only project using Gradle 6.7.1 so I upgraded to Gradle 6.8 and the problem went away.