AWS CodeBuild 无法使用 CD 命令

AWS CodeBuild unable to use CD command

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

This is a sample template for sam-app - Below is a brief explanation of what we have generated for you:

├── README.md                                   <-- This instructions file 
├── HelloWorldFunction                          <-- Source for HelloWorldFunction Lambda Function 
│   ├── pom.xml                                 <-- Java dependencies 
│   └── src 
│       ├── main 
│       │   └── java 
│       │       └── helloworld 
│       │           ├── App.java                <-- Lambda function code 
│       │           └── GatewayResponse.java    <-- POJO for API Gateway Responses object  
│       └── test                                <-- Unit tests 
│           └── java 
│               └── helloworld 
│                   └── AppTest.java 
└── template.yaml 

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

version: 0.1 

phases: 
  install: 
    commands: 
      - echo Nothing to do in the install phase... 
  pre_build: 
    commands: 
      - echo Nothing to do in the pre_build phase... 
  build: 
    commands: 
      - echo Build started on this `date` 
      - pwd 
      - ls  
      - cd ./HelloWorldFunction 
      - pwd 
      - mvn install 
  post_build: 
    commands: 
      - echo Build completed on `date` 
artifacts: 
  files: 
    - target/JavaWeb.war 

但是 CodeBuild 运行 的日志看起来 aws 无法 "change directory" 更正子文件夹。不确定我是否遗漏了什么??

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