CLI
coursier relies on sbt-pack to build its CLI from sources. sbt-pack conveniently allows to build a launcher for the CLI, either once, or continuously, while watching sources. It has the advantage of not incurring the cost of merging multiple JARs together, like generating an assembly would.
Note that this only applies during development, the final coursier
launcher generated upon each release relies on the coursier bootstrap
command, itself pulling a proguarded assembly of the cli module of coursier.
Also note that coursier relies on a slightly different sbt than the default sbt launcher so you'll want to use the ./sbt
in the project for all of the sbt related commands.
Batch mode
From freshly cloned sources, run
$ ./sbt cli/pack
to build a CLI launcher from sources. This builds a modules/cli/target/pack
directory via sbt-pack. This directory contains a coursier launcher, that can be used like
$ modules/cli/target/pack/bin/coursier launch io.get-coursier:echo:1.0.1 -- foo
Continuous mode
In a terminal window, run
./sbt "~cli/pack"
This builds a modules/cli/target/pack
directory like above, then watches the sources of coursier for changes, and re-builds that directory upon changes.
You can then run the coursier CLI from another terminal, like
$ modules/cli/target/pack/bin/coursier launch io.get-coursier:echo:1.0.1 -- foo