For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

mavenLocal

Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_LOCAL_REPO_NAME}.

Examples:

repositories {
    mavenLocal()
}

The location for the repository is determined as follows (in order of precedence):

  1. The value of system property 'maven.repo.local' if set;
  2. The value of element of ~/.m2/settings.xml if this file exists and element is set;
  3. The value of element of $M2_HOME/conf/settings.xml (where $M2_HOME is the value of the environment variable with that name) if this file exists and element is set;
  4. The path ~/.m2/repository.

Return

the added resolver

Since

0.9.1


Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_LOCAL_REPO_NAME}.

Examples:

repositories {
    mavenLocal()
}

The location for the repository is determined as follows (in order of precedence):

  1. The value of system property 'maven.repo.local' if set;
  2. The value of element of ~/.m2/settings.xml if this file exists and element is set;
  3. The value of element of $M2_HOME/conf/settings.xml (where $M2_HOME is the value of the environment variable with that name) if this file exists and element is set;
  4. The path ~/.m2/repository.

Return

the added resolver

Since

5.3

Parameters

action

a configuration action