Previous: Metals Notes, Next: ResourcesUp: Scala

Repositories

Table of Contents

1 Maven

Maven repositories are responsible for holding artefacts and dependencies, they can either be local (on a user's local machine, typically ~/.m2) or remote like maven central https://repo.maven.apache.org/maven2/.

You can add a maven repository to a mill module like so:

import coursier.maven.MavenRepository

def repositories = super.repositories ++ Seq(
  MavenRepository("https://oss.sonatype.org/content/repositories/releases")
)

Or sbt:

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/releases"

2 Ivy

You can find your local ivy cache at ~/.ivy2/cache and your local repository at ~/.ivy2/local.

3 Coursier

Both sbt and mill use coursier for artefact fetching, and as a result most artefacts consumed by them are found in the coursier cache, located at ~/.cache/coursier/v1. From here the path artefacts lie in is generally split into repositories and then the artefacts themselves (see here for more information).

Author: root

Created: 2024-03-23 Sat 11:44

Validate