## TL;DR

If it says the cache directory is empty, list the directory at the start and end of the step: dependencies may be landing somewhere else (the default maven cache is ~/.m2/repository). Static directory caching never updates when dependencies change: use file-based cache keys instead. Caches only generate on successful builds, and only caches under 1GB compressed are saved.

## Fix

1. If it says the cache directory is empty, list the directory at the start and end of the step: dependencies may be landing somewhere else (the default maven cache is ~/.m2/repository).
   Expected: You get the expected result; the problem is gone.
2. Static directory caching never updates when dependencies change: use file-based cache keys instead.
   Expected: You get the expected result; the problem is gone.

## When to use

- You are setting up or using this Bitbucket Pipelines cache missing feature.
- The symptom matches: only successful builds under 1GB save caches.

## When NOT to use

- Unrelated Bitbucket Pipelines cache missing issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against Bitbucket Pipelines cache missing. Source: https://community.atlassian.com/forums/Pipelines-questions/Pipeline-disregards-use-of-maven-cache/qaq-p/2980191.

## Variant phrasings

### only successful builds under 1GB save caches

## Why it happens

If the cache button shows nothing, the build never saved one.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

https://community.atlassian.com/forums/Pipelines-questions/Pipeline-disregards-use-of-maven-cache/qaq-p/2980191