VirtusLab / scala-cli

Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)
https://scala-cli.virtuslab.org
Apache License 2.0
544 stars 128 forks source link

Provide a more intuitive way to disable default repositories #3199

Open ghostbuster91 opened 6 days ago

ghostbuster91 commented 6 days ago

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:

Additional context https://get-coursier.io/docs/other-repositories