问题
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