首页 > 解决方案 > 如何使用 buildspec.yml 运行 gradle 构建

问题描述

有没有办法使用 buildspec.yml 文件运行 gradle 构建。buildspec.yml 文件包含一个 gradle 构建命令列表。

标签: gradlebuildyaml

解决方案


是的,它可能,PFB buildspec.yml

version: 0.1

phases:
  install:
   commands:
     - echo Entering install phase...
     - echo Nothing to do now
  build:
    commands:
     - echo Build started on `date`
     - gradle build
artifacts:
  type: zip
  files:
    - 'build/libs/*.jar'

供参考:https ://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html


推荐阅读