在AWS CodeBuild中缓存Gradle包装器 [英] Caching the Gradle wrapper in AWS CodeBuild

查看:83
本文介绍了在AWS CodeBuild中缓存Gradle包装器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我当前的buildspec的样子:

This is what my current buildspec looks like:

phases:
  build:
    commands:
      - ./gradlew soakTest -s

cache:
  paths:
    - '/root/.gradle/caches/**/*'
    - '.gradle/**/*'

但是,当此buildspec在CodeBuild中运行时,它会打印下载gradle 4.7的消息. 看来其他东西正在正确缓存-例如,我看不到有关下载jar依赖项的日志消息.

But when this buildspec runs in CodeBuild, it prints messages that it is downloading gradle 4.7. It appears that other things are being cached correctly - I don't see log messages about downloading jar dependencies, for example.

buildspec缓存规范应该是什么样子,以确保Gradle包装器下载的Gradle版本得到缓存?

What should the buildspec cache specifications look like, in order to make sure the Gradle version that the Gradle wrapper downloads gets cached?

推荐答案

将包装器目录添加到缓存路径:

Add the wrapper directory to the cache paths:

- '/root/.gradle/wrapper/**/*'

这篇关于在AWS CodeBuild中缓存Gradle包装器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆