Since [2.3.0](https://github.com/actions/setup-java/releases/tag/v2.3.0), the setup-java GitHub actions have a built-in cache mechanism which simplifies configuration of the workflow.