# Depot Cache now supports Maven (https://depot.dev/changelog/2025-05-07-depot-cache-maven-support)

> Published 2025-05-07

We've added support for Maven to Depot Cache. This lets you instantly share your Maven cache between CI and local development environments.

If you're using Depot GitHub Actions runners, we've already pre-configured the runner to use Depot Cache when building Maven artifacts. We also support using Depot Cache in a Maven project outside of our runners.

You must configure a remote cache server in your `~/.m2/settings.xml` file. Configure Maven to use the Depot Cache service endpoints and set your API token where there is the `DEPOT_TOKEN` below:

`settings.xml`:

```xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <servers>
        <server>
            <id>depot-cache</id>
            <configuration>
                <httpHeaders>
                    <property>
                        <name>Authorization</name>
                        <value>Bearer DEPOT_TOKEN</value>
                    </property>
                </httpHeaders>
            </configuration>
        </server>
    </servers>
</settings>
```

Next, you can configure the [Maven Build Cache extension](https://maven.apache.org/extensions/maven-build-cache-extension/) to use this server in `.mvn/maven-build-cache-config.xml`:

```xml
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd">
    <configuration>
        <enabled>true</enabled>
        <hashAlgorithm>SHA-256</hashAlgorithm>
        <validateXml>true</validateXml>
        <remote enabled="true" saveToRemote="true" id="depot-cache">
            <url>https://cache.depot.dev</url>
        </remote>
        <projectVersioning adjustMetaInf="true" />
    </configuration>
</cache>
```

You can read more about configuring Maven to use Depot Cache in our [Maven documentation](/docs/cache/integrations/maven).

## For AI Agents

The full site index is at [llms.txt](https://depot.dev/llms.txt). Append `.md` to any documentation, blog, changelog, or customer URL to fetch its markdown source directly.