更新时间:2024-01-22 GMT+08:00
分享

使用yaml配置Maven构建

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
version: 2.0 # 必须是2.0
steps:
  BUILD:
    - maven:
          image: cloudbuild@maven3.5.3-jdk8-open # 可以自定义镜像地址,请看下方说明
          inputs:
            settings:
              public_repos:
                - https://mirrors.example.com/maven
            cache: true # 是否开启缓存
            unit_test:
              coverage: true
              ignore_errors: false
              report_path: "**/TEST*.xml"
              enable: true
              coverage_report_path: "**/site/jacoco"
            command: mvn package -Dmaven.test.failure.ignore=true -U -e -X -B

image有两种格式:

1. cloudbuild@maven3.5.3-jdk8-open ,以cloudbuild开始,@作为分隔符,后面是编译构建提供的默认镜像。

2. 完整的swr镜像地址,例如:swr.example.example.com/codeci_test/demo:141d26c455abd6d7xxxxxxxxxxxxxxxxxxxx

配置说明

参数名

参数类型

描述

是否必填

默认值

settings

map

maven构建的setting配置。

cache

bool

是否开启缓存。

false

command

string

执行命令。

unit_test

map

单元测试。

单元测试(unit_test)层级下参数说明:

参数名

参数类型

描述

是否必填

默认值

enable

bool

是否处理单元测试数据。

true

ignore_errors

bool

是否忽略单元测试错误。

true

report_path

String

单元测试数据路径。

converage

bool

是否处理覆盖率数据。

false

coverage_report_path

string

覆盖率数据路径。

分享:

    相关文档

    相关产品