0

我正在尝试从我的 GitLab 私有 Maven 存储库中注册一个任务...

我使用以下属性启动 Spring Cloud DataFlow 和 Skipper:

maven.remote-repositories.gitlab.url: ${GITLAB_PACKAGE_REPOSIOTRY_URL}
maven.remote-repositories.gitlab.auth.username: ${GITLAB_PACKAGE_REPOSIOTRY_USERNAME}
maven.remote-repositories.gitlab.auth.password: ${GITLAB_PACKAGE_REPOSIOTRY_PASSWORD}

所以我将应用程序注册为:

maven://com.xxx:dummy:0.0.1

当我尝试启动一项任务时,它无法解决说:

dataflow-server_1    | java.lang.IllegalStateException: Failed to resolve MavenResource: com.xxx:dummy:jar:0.0.1. Configured remote repositories: : [gitlab],[springRepo]

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.xxx:dummy:jar:0.0.1 from/to springRepo (https://repo.spring.io/libs-snapshot): status code: 401, reason phrase: Unauthorized (401)

似乎 SCDF 尝试仅从 springRepo 而不是从 gitlab 下载 maven 包。

我错过了什么吗?

4

1 回答 1

0

使用这些属性:

maven:
  use-wagon: true
  remote-repositories:
    gitlab:
      url: ${GITLAB_PACKAGE_REPOSIOTRY_URL}
      wagon:
        http:
          all:
            use-preemptive: true
      auth:
        username: ${GITLAB_PACKAGE_REPOSIOTRY_USERNAME}
        password: ${GITLAB_PACKAGE_REPOSIOTRY_PASSWORD}

适用于 Spring Cloud Data Flow 和 Skipper Server

于 2022-01-28T10:44:59.007 回答