To reduce load on Maven Central and help avoid rate limit errors when pulling dependencies, CircleCI has introduced a registry cache and proxy. You can opt in to this by running the following command in your job before any dependency installation steps:
circleci experiment registry config --maven
This writes a Maven settings file to ~/.m2/settings.xml that mirrors Maven Central through the CircleCI proxy. It also exports CIRCLECI_MAVEN_REGISTRY_ENDPOINT and CIRCLECI_REGISTRY_TOKEN to $BASH_ENV for use in subsequent steps.
Additional flags are available:
--gradleconfigures Gradle to use the proxy--leinconfigures Leiningen to use the proxy--allconfigures all three (Maven, Gradle, and Leiningen)--envexports registry credentials as environment variables only, without writing config files
This is an experimental command and the interface may change. We plan to add support for additional package registries and to make this configuration automatic in future updates.