【问题标题】:Could not find artifact - cloud builder step failure (Google Cloud Builder)找不到工件 - 云构建器步骤失败 (Google Cloud Builder)
【发布时间】:2018-01-24 05:50:32
【问题描述】:

其中一个 google 容器构建器步骤失败,因为它依赖于上一步生成的文件。

buildspec 中的所有步骤都在一台机器上执行吗?请建议是否有更好的方法来执行此操作,或者我是否需要在构建规范中添加任何额外的步骤?

构建规范:

steps:
- name: 'gcr.io/cloud-builders/mvn'
  args: ['install:install-file', '-Dfile=locallib/wlthint3client.jar', '-DgeneratePom=true',  '-DgroupId=com.oracle.weblogic', '-DartifactId=wlthint3client', '-Dversion=10.3', '-Dpackaging=jar']
- name: 'gcr.io/cloud-builders/gradle'
  args: ['build']

步骤 0:直接在 maven 本地 repo 中安装 JAR

第 1 步:依赖此 JAR 的 Gradle 构建

在步骤 0 成功而步骤 1 不成功的云生成器日志下方,步骤 1 找不到步骤 0 安装的 jar:

Step #0: [INFO] Installing /workspace/locallib/wlthint3client.jar to /root/.m2/repository/com/oracle/weblogic/wlthint3client/10.3/wlthint3client-10.3.jar
Step #0: [INFO] Installing /tmp/mvninstall2626838898258363583.pom to /root/.m2/repository/com/oracle/weblogic/wlthint3client/10.3/wlthint3client-10.3.pom
Step #0: [INFO] ------------------------------------------------------------------------
Step #0: [INFO] BUILD SUCCESS
Step #0: [INFO] ------------------------------------------------------------------------
Step #0: [INFO] Total time: 3.529 s
Step #0: [INFO] Finished at: 2018-01-24T05:11:36Z
Step #0: [INFO] Final Memory: 10M/56M
Step #0: [INFO] -
Step #1: * What went wrong:
Step #1: Could not resolve all dependencies for configuration ':detachedConfiguration5'.
Step #1: > Could not find com.oracle.weblogic:wlthint3client:10.3.
Step #1:   Searched in the following locations:
Step #1:       file:/root/.m2/repository/com/oracle/weblogic/wlthint3client/10.3/wlthint3client-10.3.pom
Step #1:       file:/root/.m2/repository/com/oracle/weblogic/wlthint3client/10.3/wlthint3client-10.3.jar
Step #1:       https://repo1.maven.org/maven2/com/oracle/weblogic/wlthint3client/10.3/wlthint3client-10.3.pom
Step #1:       https://repo1.maven.org/maven2/com/oracle/weblogic/wlthint3client/10.3/wlthint3client-10.3.jar
Step #1:   Required by:
Step #1:       project :
Step #1:**

【问题讨论】:

    标签: maven gradle google-cloud-platform google-container-builder


    【解决方案1】:

    根据我的经验,我所了解的是,在 google 容器构建器中,每个构建步骤都在不同的虚拟机中执行。所以我通过修改我的构建规范解决了上述问题。

    构建规范只需一步即可上传工件并构建项目。

     steps:
     - name: 'gcr.io/cloud-builders/gradle'
       args: ['uploadResultArchives','build']
    

    【讨论】:

    • 你是如何上传工件的?更多细节请因为我遇到了同样的问题
    猜你喜欢
    • 2020-02-02
    • 2019-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 2020-11-20
    相关资源
    最近更新 更多