You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|Accepts predefined repositories supported by Coursier (like `sonatype:snapshots` or `m2Local`) or a URL of the root of Maven repository""".stripMargin
Copy file name to clipboardExpand all lines: website/docs/guides/dependencies.md
+38-3Lines changed: 38 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,41 @@ For example:
37
37
org.postgresql:postgresql:42.2.8
38
38
```
39
39
40
+
### Repositories
41
+
42
+
Sometimes dependencies are published into non-standard repositories, like nightly builds published to Sonatype Snapshots. Scala CLI can use additional maven and ivy repositories with the `repository` directive or `--repository` command line options:
Both directive and command line option accept predefined repository definitions (see below) or a URL of the root of Maven repository.
55
+
56
+
Repositories can also be resolved from the `COURSIER_REPOSITORIES` environment variable, but this is not recommended (more in [Coursier documentation](https://get-coursier.io/docs/other-repositories)).
57
+
58
+
#### Predefined repositories
59
+
60
+
61
+
| predefined repository | kind | description |
62
+
| ---------- | ---- | --- |
63
+
| central | Maven [(root)](https://repo1.maven.org/maven2)| Used by default, default repository for most Scala libraries |
64
+
| sonatype:snapshots| Maven [(root)](https://oss.sonatype.org/content/repositories/snapshots)| Repositories where most Scala libraries publish its snapshots / nightly builds. Used when `X.nightly` is used as Scala version e.g. `3.1.nightly`. |
65
+
| ivy2local | Ivy | Local ivy repository, used to publish things locally (e.g. by `publishLocal`). Localized in `<ivy-home>/local`, usually `<user-home>/.ivy/local`. |
66
+
| m2Local | Maven | Local maven repository, localized in `<user-home>/.m2/repository`|
67
+
68
+
Scala CLI delegates parsing of predefined repositories to Coursier and full details can be obtains from Coursier source code ([here](https://github.com/coursier/coursier/blob/2444eebcc151e0f6927e269137e8737c1f31cbe2/modules/coursier/jvm/src/main/scala/coursier/LocalRepositories.scala) and [here](https://github.com/coursier/coursier/blob/2444eebcc151e0f6927e269137e8737c1f31cbe2/modules/coursier/shared/src/main/scala/coursier/internal/SharedRepositoryParser.scala))
69
+
70
+
71
+
72
+
73
+
74
+
40
75
### Excluding Transitive Dependencies
41
76
42
77
To exclude a transitive dependency from a Scala CLI project use the `exclude` parameter:
@@ -98,7 +133,7 @@ It is possible to declare dependencies limited to the test scope with the `using
98
133
`````
99
134
100
135
More details can be found in
101
-
the [`using` directives guide](./using-directives.md#directives-with-a-test-scope-equivalent).
136
+
the [`using` directives guide](./using-directives#directives-with-a-test-scope-equivalent).
0 commit comments