# Maven Repository Setup and Publishing

> Use CloudRepo from Maven: settings.xml, publishing, the 409 Conflict, snapshot cleanup, proxies, and groups (Nexus maven-public, Artifactory virtual).

CloudRepo hosts Maven repositories for Maven and for the build tools that read them. Each repository has a kind, which you pick when you create it:

| Kind                                         | What it does                                                                                          |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **Hosted** (Nexus hosted, Artifactory local) | Stores the artifacts you publish.                                                                     |
| **Proxy** (Nexus proxy, Artifactory remote)  | Fetches from a public Maven repository you pick from a list, such as Maven Central, and keeps a copy. |
| **Group** (Nexus group, Artifactory virtual) | One URL in front of several Maven repositories. Read only.                                            |

## Connect Maven

- [Publish Maven artifacts](/docs/publish/maven.html) with `mvn deploy`.
- [Pull Maven artifacts](/docs/consume/maven.html) in your builds.
- [Proxy repositories](/docs/consume/proxy-repositories.html): pull Maven Central and other public repositories through CloudRepo.
- Gradle: [publish](/docs/publish/gradle.html) and [pull](/docs/consume/gradle.html). Android: [Use CloudRepo with an Android project](/docs/formats/android.html).

## Maven Repository Settings

Besides the [standard settings](/docs/manage/repositories.html#repository-settings) of every repository, a Maven repository has [Maven Snapshot Cleanup](/docs/publish/maven.html#maven-snapshot-cleanup) and Overwrite Protection.

### Maven Overwrite Protection

Overwrite Protection is on by default. A second publish of a release version is refused with `409 Conflict`: publish a new version. [Snapshots and releases](/docs/publish/maven.html#snapshots-and-releases) says what it covers and how to turn it off.

## Maven group repositories (Nexus maven-public, Artifactory virtual)

A group gives your builds one URL for several Maven repositories, such as your Hosted repositories and a Proxy of Maven Central. [Pull through a group](/docs/consume/maven.html#pull-through-a-group-nexus-maven-public-artifactory-virtual) shows how to create one, point Maven at it and make a token that reads it.

---

The page: https://www.cloudrepo.io/docs/formats/maven.html
