Skip to main content

2.0.0-RC1

This post describes the most notables changes of coursier 2.0.0-RC1.

Strict conflict manager​

The CLI now accepts options to enable and configure the new strict conflict manager.

  • --strict enables the strict conflict manager,
  • --strict-exclude org:name excludes some modules from being inspected by the strict conflict manager,
  • --strict-include org:name includes some modules (even if they were excluded by --strict-exclude).

install command​

The CLI of coursier now has an install command. This command was demo-ed during the Scala Days talk "All the fancy things you can do with flexible dependency management".

The environment variable COURSIER_EXPERIMENTAL needs to be true for this command to be enabled. It then allows things like

$ coursier install scalac sbt-launcher

It installs launchers for these applications in an OS-specific directory (~/Library/Application Support/Coursier/bin on OS X, ~/.local/share/coursier/bin on Linux), and will warn you if that directory isn't in your PATH.

It also allows to install GraalVM applications if GRAALVM_HOME is set (coursier install coursier-graalvm), and scala-native ones too if LLVM is installed (coursier install echo-native).

It should be described in more detail in a later post and / or dedicated page in the coursier website.

publish command​

The CLI of coursier now has a publish command, allowing to publish arbitrary sbt projects and directories with a Maven repository-like structure. It's quite experimental, and should be documented in a later time.

Dynamically load scala-native tools​

The --native option of the bootstrap command can now deal with several scala-native versions. It automatically detects the scala-native version of the dependencies it is passed, and downloads and uses the scala-native tools from that scala-native version

For example, both of these command work, and use either scala-native 0.3.9, or 0.4.0-M2:

$ coursier bootstrap io.get-coursier:echo_native0.3_2.11:1.0.1 \
-o echo-native-0.3 \
--native
$ coursier bootstrap io.get-coursier:echo_native0.4.0-M2_2.11:1.0.3 \
-o echo-native-0.4.0-M2 \
--native

Dependency string completion​

coursier now has an API and a CLI command to complete dependency strings, like

val (fromIndex, completions) = coursier.Complete()
.withInput("com.chuusai::shapeless:")
.withScalaVersion("2.12.8")
.complete()
$ coursier complete --scala-version 2.12.8 com.chuusai::shapeless:
2.3.2
2.3.3

Fixes​

Fix bug in resolution preventing software.amazon.awssdk:utils:2.5.17 and software.amazon.awssdk:auth:2.5.17 to be resolved fine.

Other​

  • --what-depends-on now accepts patterns like org:* or foo-*:name (thanks to @viqueen
  • upon checksum error, both the underlying file and checksum file are deleted from the cache, and downloaded again (no other attempt / deletion is the second one still fails)
  • global exclusions can be passed to coursier.Resolve and coursier.Fetch (rather than manually applied to each dependency)
  • early support for latest.release and latest.integration versions (improved upon in later versions)
  • versions like 0+ are now handled fine
  • launchers generated by the bootstrap command now read the environment variable JAVA_OPTS when they invoke java