简体   繁体   中英

Using multiple Gitlab registries in single Gradle file

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM