Hi there,
I have a problem with the maven cache.
On the first step I see that cache is extracted successfully:
Cache "mvnrepo": Downloading
Cache "mvnrepo": Downloaded 55 MB in 4 seconds
Cache "mvnrepo": Extracting
Cache "mvnrepo": Extracted in 0 seconds
No new dependencies downloaded during this step and in "Build teardown" section I see:
Cache "mvnrepo": Skipping upload for existing cache
On the second step I see again that cache is extracted successfully, but then new dependencies are downloaded during this step. But in "Build teardown" section I see again that cache uploading is skipped. And of course, when I rerun this build, this dependencies are again downloaded on the second step.
What should I change for update cache after second step to save cache between builds and avoid downloading dependencies again and again?
My bitbucket-pipelines.yml file:
image: maven:3.3.9
pipelines:
default:
- step:
name: Unit testing
caches:
- mvnrepo
script:
- mvn -B test
- step:
name: Package build
caches:
- mvnrepo
script:
- mvn -B package -DskipTests
definitions:
caches:
mvnrepo: /root/.m2/repository
I tried using default 'maven' cache name in caches section, but the result is the same.