gpt4 book ai didi

maven - 找不到 Artifact -Cloud Builder步骤失败(Google Cloud Builder)

转载 作者:行者123 更新时间:2023-12-03 05:49:50 26 4
gpt4 key购买 nike

Google容器构建器步骤之一失败,因为它取决于上一步生成的文件。

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

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本地仓库中安装JAR

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

在Cloud Builder的日志下方,其中步骤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:**

最佳答案

以我的经验,我在Google容器构建器中了解到,每个构建步骤都在不同的VM中执行。因此,我通过修改构建规范解决了上述问题。

只需一步即可构建规格,以上传 Artifact 并构建项目。

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

关于maven - 找不到 Artifact -Cloud Builder步骤失败(Google Cloud Builder),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48415628/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com