scala-cli
scala-cli copied to clipboard
Provide a more intuitive way to disable default repositories
Is your feature request related to a problem? Please describe.
When working in a corporate environment we often tend to use private instance of maven repository. In such case it might be necessary to avoid reaching out to public repositories (e.g. maven central). This can be due to company policies or simply by wanting to avoid DDOSing the public infrastructure.
Currently, repositories for scala-cli can be added by --repository https://scala-cli.virtuslab.org/docs/reference/cli-options#--repository but there is no builtin way to remove the default ones (e.g. maven central).
Coursier exposes --no-default flag for this case but there is no way to pass this flag through scala-cli.
Describe the solution you'd like
Add equivalent of coursier's --no-default so that it is easy to opt-out from using public repositories.
Describe alternatives you've considered
So far I have been setting -Dcoursier.repositories=myprivate.maven.corp/maven|myprivate.maven.corp/maven-snapshots when calling scala-cli which works, but:
- it wasn't straightforward to discover
- it is not documented
- seems potentially unsafe, as coursier is an implementation detail and this behavior could change.
Additional context https://get-coursier.io/docs/other-repositories