Skip to content

Commit

Permalink
Installation: document COURSIER_REPOSITORIES
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Aug 28, 2023
1 parent 8213992 commit 1e2d9b8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ formatter, the correct release will be downloaded dynamically.

> Since v3.1.0, the `version` parameter is required to be specified explicitly.
Since that requires access to artifact repositories, please see more on that on the
[Installation](installation.md#using-custom-repositories-with-cli) page.

## Scala Dialects

The formatter supports various dialects defined and supported by `scalameta` parser. However,
Expand Down
28 changes: 28 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,34 @@ println(website.plaintext(org.scalafmt.cli.CliArgParser.buildInfo))
println(website.plaintext(org.scalafmt.cli.CliArgParser.scoptParser.usage))
```

### Using custom repositories with CLI

Under the hood, `scalafmt` uses the `scalafmt-dynamic` library and, in turn,
`coursier`, to download the version (of `scalafmt-core`) specified in
`.scalafmt.conf` file.

By default, coursier will download from a few standard repositories (including
sonatype, both public and snapshot). However, if you'd like to use instead some
custom repositories within your environment, please specify them using the
`COURSIER_REPOSITORIES` environment variable.

#### Repository credentials

Additionally, if your repositories require credentials, please specify them
in the [`COURSIER_CREDENTIALS`](https://get-coursier.io/docs/other-credentials)
environment variable.

Keep in mind that `coursier` credential format is not the same as, say, `sbt`,
and since multiple entries are allowed and expected, each requires a unique
prefix of your choosing.

Others have also reported needing to include in their credentials settings such as

```
<prefix>.pass-on-redirect=true
<prefix>.auto=true
```

## Gradle

It is possible to use scalafmt in gradle with the following externally
Expand Down

0 comments on commit 1e2d9b8

Please sign in to comment.