Enable and configure Gradle build cache for local and remote use with Develocity

domain: docs.gradle.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable the local build cache in gradle.properties: org.gradle.caching=true — this activates both local and (if configured) remote caching for all builds
  2. Add the Develocity plugin to settings.gradle: plugins { id 'com.gradle.develocity' version 'CURRENT_VERSION' } and configure the server URL: develocity { server = 'https://your-develocity-server.example.com' }
  3. Configure the remote build cache in settings.gradle inside a buildCache block: remote(HttpBuildCache) { url = 'https://your-develocity-server.example.com/cache/'; push = System.getenv('CI') == 'true' } to push only from CI
  4. Authenticate remote cache pushes by setting credentials via an environment variable or a .gradle/gradle.properties file with buildCache.remote.username and buildCache.remote.password; do not commit credentials
  5. Make tasks cacheable by annotating task inputs and outputs with @Input, @InputFiles, @OutputFile etc. in custom task code; built-in Gradle tasks (compileJava, test) are cacheable by default
  6. Inspect cache performance by opening the build scan on your Develocity server and reviewing the Build Cache tab for hit/miss rates and savings

Known gotchas

Related routes

Enable Turborepo remote caching to share build artifacts across CI runners and developer machines
turbo.build/repo/docs/core-concepts/remote-caching · 6 steps · unrated
Configure a DVC pipeline stage with an external S3 dependency and output that DVC does not cache locally
doc.dvc.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans