首页 > 解决方案 > YAKS 在独立 Kubernetes 集群上失败

问题描述

独立 Kubernetes 集群上的 YAKS 尝试下载 surefire-junit4 jar 失败。我已经向 ~/.m2/settings.xml 添加了一个镜像仓库以指向本地 maven 存储库,并将我的本地 maven 仓库添加到 yaks-config.yaml,但显然没有成功将 Y​​AKS 容器指向我的本地 maven回购。

$ yaks test helloworld.test
test "helloworld" updated
+ test-helloworld-c287tt0uobphu24pdl8g-xgjnx > test
test-helloworld-c287tt0uobphu24pdl8g-xgjnx test [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.22.2:integration-test (integration-tests) yaks-runtime-maven: Unable to generate classpath: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information for org.apache.maven.surefire:surefire-junit4:jar:2.22.2: Failed to retrieve POM for org.apache.maven.surefire:surefire-junit4:jar:2.22.2: Could not transfer artifact org.apache.maven.surefire:surefire-junit4:pom:2.22.2 from/to central (https:repo.maven.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.22.2/surefire-junit4-2.22.2.pom
test-helloworld-c287tt0uobphu24pdl8g-xgjnx test [ERROR]   org.apache.maven.surefire:surefire-junit4:jar:2.22.2
test-helloworld-c287tt0uobphu24pdl8g-xgjnx test [ERROR]
test-helloworld-c287tt0uobphu24pdl8g-xgjnx test [ERROR] from the specified remote repositories:
test-helloworld-c287tt0uobphu24pdl8g-xgjnx test [ERROR]   central (https://repo.maven.apache.org/maven2, releases-true, snapshots=false)

要测试的功能是简单的 hello world:

Feature: Hello

  Scenario: Print hello message
    Given print 'Hello from YAKS!'

创建了 pod 和容器,因此 YAKS 成功地从本地 docker 注册表中提取了 docker.io/citrusframework/yaks:0.3.0 映像。

标签: mavenkubernetes

解决方案


推荐阅读