Skip to content

Scala‑CLI ignores repository mirrors and Coursier env vars for toolchain downloads #4196

@meier-christoph

Description

@meier-christoph

Scala‑CLI continues to contact upstream repositories during Scala toolchain resolution even when:

  • repositories.mirrors is configured via --power config
  • Coursier environment variables (e.g. COURSIER_REPOSITORIES) are set
  • only an internal Nexus repository is reachable

Environment

  • Scala‑CLI: 1.12.5 (JAR)
  • OS: Windows 11
  • Network: outbound internet blocked
  • Only internal Nexus allowed
  • We use the standalone JAR because the native executable cannot run in our environment due to PKI/certificate validation issues.

Reproduction

  1. Configure mirror:
$ java -jar scala-cli.jar --power config repositories.mirrors maven:*=https://nexus.company.com/
  1. Confirm mirror is stored:
$ java -jar scala-cli.jar --power config repositories.mirrors 
> maven:*=https://nexus.company.com/repository/mvn-all/
  1. Run any command that triggers toolchain resolution:
$ java -jar scala-cli.jar --power --verbose compile Hello.scala
  1. Scala‑CLI still attempts to fetch toolchain artifacts from upstream, e.g.:

Expected

Scala‑CLI should respect configured mirrors (or Coursier env vars) for all repository traffic, including toolchain artifacts.

Actual

Mirrors and env vars are ignored for toolchain resolution. Scala‑CLI always falls back to upstream repos, which are blocked.

Request

Clarification on whether toolchain repository resolution is intended to support mirrors, and if not, whether a mechanism can be provided to override it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoursierIssues tied with coursier integration.dependency managementIssues tied to how the CLI manages project dependencies.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions