Question: I'm using ammonite (<http://ammonite.io/>) to write Scala scripts. It allows you to fetch remote dependencies via this kind of text:

```
import $ivy.`org.scalaz::scalaz-core:7.2.7`, scalaz._, Scalaz._

```

How do you use a local maven repo (sitting in e.g. ~/.m2), though?

Answer: 
With many thanks to @sake92 on <https://gitter.im/lihaoyi/Ammonite>

```
#!/usr/bin/env amm

interp.repositories() ++= Seq(coursier.Cache.Dangerous.maven2Local)

@

import $ivy.`com.foo:artifact:1.3.0`

```

The @ forces the script to be compiled in two parts. Without it the extra repo will simply be ignored.
There was [an issue some time ago](https://github.com/lihaoyi/Ammonite/issues/611)
 with [a following PR](https://github.com/lihaoyi/Ammonite/pull/612) that concluded that there quite often local Maven repository contains broken things, so it is not there by default.

However, later ability to add your own resolvers was added, probably sth like:

```
import coursier.MavenRepository

interp.repositories() ++= Seq(MavenRepository(
  "~/.m2/local"
))

```

should work.