Caching the Gradle wrapper in AWS CodeBuild

一个人想着一个人 提交于 2020-04-11 06:04:14

问题


This is what my current buildspec looks like:

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

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

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.

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


回答1:


Add the wrapper directory to the cache paths:

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


来源:https://stackoverflow.com/questions/50126601/caching-the-gradle-wrapper-in-aws-codebuild

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!