Description
Scala CLI already embeds a non-trivial portion of Coursier for its dependency resolution needs.
I propose exposing scala coursier
as a separate command with subcommands such as (but not limited to)
launch
resolve
fetch
bootstrap
to provide immediate access to the full ecosystem of packages, coursier channels, etc.
Currently coursier is in a weird place – it's the de facto dependency resolution mechanism for both SBT and Mill, it is the official way of installing Scala, it is used to resolve and bootstrap CLIs, it has incredibly helpful poweruser functions to fetch classpaths and resolve dependency trees.
And yet:
- it's hosted in a separate organisation, not affiliated with either Scala Center, VirtusLab, Lightbend, or EPFL
- it requires separate installation
- it's not available in official package managers in Windows and in some Linux distributions
With Scala CLI being the official launcher (and hopefully at some point being simply a apt install scala
away...), I believe requiring a separate installation of coursier to get access to same functionality is unnecessary.
Workaround for the impatient:
$ scala-cli run --dep io.get-coursier:coursier-cli_2.12:2.1.5 --scala-snippet 'object A' -S 2.12 -M coursier.cli.Coursier -- java --available
...
adoptium:1.11.0.15
adoptium:1.11.0.16
adoptium:1.11.0.16.1
adoptium:1.11.0.17
adoptium:1.11.0.18
adoptium:1.11.0.19
adoptium:1.17
adoptium:1.17.0.1
adoptium:1.17.0.2
adoptium:1.17.0.3