api / org.gradle.api.artifacts.dsl / RepositoryHandler / mavenCentral

mavenCentral

abstract fun mavenCentral(args: MutableMap<String, *>): MavenArtifactRepository

Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#MAVEN_CENTRAL_URL}.

The following parameter are accepted as keys for the map:

Key Description of Associated Value name (optional) The name of the repository. The default is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_CENTRAL_REPO_NAME} is used as the name. A name must be unique amongst a repository group. artifactUrls A single jar repository or a collection of jar repositories containing additional artifacts not found in the Maven central repository. But be aware that the POM must exist in Maven central. The provided values are evaluated as per org.gradle.api.Project#uri(Object).

Examples:

 repositories { mavenCentral artifactUrls: ["http://www.mycompany.com/artifacts1", "http://www.mycompany.com/artifacts2"] mavenCentral name: "nonDefaultName", artifactUrls: ["http://www.mycompany.com/artifacts1"] } 

Parameters

args - A list of urls of repositories to look for artifacts only.

Return
the added repository

abstract fun mavenCentral(): MavenArtifactRepository

Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#MAVEN_CENTRAL_URL}. The name of the repository is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_CENTRAL_REPO_NAME}.

Examples:

 repositories { mavenCentral() } 

Return
the added resolver

See Also
#mavenCentral(java.util.Map)