AWS CodeBuild 无法使用 CD 命令

Lav*_*Lav 2 amazon-web-services aws-lambda aws-codecommit aws-codebuild

我在 CodeCommmit 中有一个非常简单的 Hello World Java 项目,具有以下结构

\n\n
This is a sample template for sam-app - Below is a brief explanation of what we have generated for you:\n\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 README.md                                   <-- This instructions file \n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 HelloWorldFunction                          <-- Source for HelloWorldFunction Lambda Function \n\xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 pom.xml                                 <-- Java dependencies \n\xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src \n\xe2\x94\x82       \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main \n\xe2\x94\x82       \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 java \n\xe2\x94\x82       \xe2\x94\x82       \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 helloworld \n\xe2\x94\x82       \xe2\x94\x82           \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 App.java                <-- Lambda function code \n\xe2\x94\x82       \xe2\x94\x82           \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 GatewayResponse.java    <-- POJO for API Gateway Responses object  \n\xe2\x94\x82       \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 test                                <-- Unit tests \n\xe2\x94\x82           \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 java \n\xe2\x94\x82               \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 helloworld \n\xe2\x94\x82                   \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 AppTest.java \n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 template.yaml \n
Run Code Online (Sandbox Code Playgroud)\n\n

我正在使用 CodeBuild,我的 buildspec.yml 看起来像

\n\n
version: 0.1 \n\nphases: \n  install: \n    commands: \n      - echo Nothing to do in the install phase... \n  pre_build: \n    commands: \n      - echo Nothing to do in the pre_build phase... \n  build: \n    commands: \n      - echo Build started on this `date` \n      - pwd \n      - ls  \n      - cd ./HelloWorldFunction \n      - pwd \n      - mvn install \n  post_build: \n    commands: \n      - echo Build completed on `date` \nartifacts: \n  files: \n    - target/JavaWeb.war \n
Run Code Online (Sandbox Code Playgroud)\n\n

但是 CodeBuild 运行的日志看起来像 aws 无法“更改目录”来更正子文件夹。不确定我是否遗漏了什么??\n在此输入图像描述

\n

Sub*_*hew 5

请将构建规范更改为版本 0.2(从 0.1),这应该可以解决此问题。