简体   繁体   English

在单个 Gradle 文件中使用多个 Gitlab 注册表

[英]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.我需要在 gradle.build 中包含来自 Gitlab 的 3 个 Maven 包,但我在某个地方磕磕绊绊。 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).找不到 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>在以下位置搜索:<当我导航到它或使用 curl 和项目使用的相同私有令牌 ping 它时完全有效的 URL>

All three repo includes take the form:所有三个 repo 都包括以下形式:

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. ENV_VAR 解决得很好,端点都可以访问。 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.我已经尝试使用实例级端点,但这似乎会导致更多问题,因为我们托管在 gitlab.com 与多部分组 url 似乎没有格式。

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.我注意到这是唯一使用 Gradle 6.7.1 的项目,所以我升级到 Gradle 6.8,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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