Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Feb 08 23:17
    d-albrecht opened #2688
  • Feb 06 20:39
    ScalaWilliam edited #2686
  • Feb 06 14:59

    alexarchambault on gh-pages

    Update website (compare)

  • Feb 06 14:25

    tgodzik on main

    Fix reflection deprecation Don't forget to create instance… Merge pull request #2684 from e… (compare)

  • Feb 06 14:25
    tgodzik closed #2684
  • Feb 06 09:51
    ScalaWilliam edited #2686
  • Feb 06 09:06
    ScalaWilliam edited #2686
  • Feb 06 09:06
    ScalaWilliam edited #2686
  • Feb 06 09:04
    ScalaWilliam edited #2686
  • Feb 06 08:46
    ScalaWilliam opened #2686
  • Feb 04 14:47
    scala-steward opened #2685
  • Feb 03 16:12
    ekrich commented #2684
  • Feb 03 16:11
    ekrich commented #2684
  • Feb 03 15:41
    ekrich commented #2684
  • Feb 03 15:09
    ekrich synchronize #2684
  • Feb 02 14:40
    mkurz commented #2647
  • Feb 02 14:32
    doehyunbaek commented #2647
  • Feb 01 21:15
    ekrich commented #2684
  • Feb 01 17:14
    ekrich opened #2684
  • Feb 01 14:43
    julienrf closed #2669
Kevin Sjöberg
Unless I set JAVA_HOME to the output of cs java-home again.
As an example, running scala now spits out The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java..
Florian Schmaus
@kevinsjoberg it appears you need to set JAVA_HOME to something sensible then. not sure about the internals of coursier, but some apps are just happy with java in PATH
note that I too have JAVA_HOME set, just not with a value provided by couriser
Kevin Sjöberg
I'm so confused. I understand the purpose of JAVA_HOME, but I do have a JVM installation outside of Coursier. It was needed to actually run Coursier itself. Then Coursier installs another JVM that it manages.
I could of course use direnv and create a .envrc file that sets things up using cs java --env but I'm still confused how things is intended to work.
How do I choose what JVM to use? Can I list installed JVMs (I've only found cs list that lists installed apps)?
Eric K Richardson
I used sdkman to install Java 8, 11, and 17 zulu which are ARM only and it allows you do switch via
sdk list java
sdk install java 17.0.2-zulu
Eric K Richardson
If you install it asks if you want to make it default.
sdk use java 17.0.3-zulu
for this terminal only
daniel sieradski

Hello, I'm totally new to Scala so please forgive me in advance if I'm slow on the uptake here... I installed coursier via Homebrew. Then I added a channel from Maven with cs channel --add https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/maven-metadata.xml. It showed the channel as properly installing. So far so good. But then when I try to install or resolve the package, I get:

cs resolve gatling-charts-highcharts-bundle      
Exception in thread "main" java.lang.Exception: java.lang.Exception: Error decoding /Users/daniel/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/maven-metadata.xml (https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/maven-metadata.xml): Unexpected content found: <?xml version="1.0" encoding="UTF-8"?>

Any ideas what I'm doing wrong here? Thanks.

daniel sieradski
Ok, I figured out what I was doing wrong insofar as how to setup a channel. But now I can't get the JSON file to work. What am I doing wrong?
    "repositories": ["central"],
    "dependencies": ["io.gatling.highcharts::gatling-charts-highcharts-bundle:3.2.1"]
Anyone know how I can get the java-home command to print the path for the linux-musl version of the JDK on Alpine?
How to I tell coursier to stfu and stop looking for sources.jar and javadoc.jar for a library? At least in ivy it only produced a warning.
Iwan Aucamp
Coursier is awesome
it is the tool I always wanted for JVM
Really great job
Damian Reeves
Hi. I posted this discussion some time ago (https://github.com/coursier/coursier/discussions/2404) and was hoping someone could help me figure this out.

My company has a proxy repository which all artifact access is fronted by.
As such in sbt, we use the configuration details mentioned here: https://www.scala-sbt.org/1.x/docs/Proxy-Repositories.html#sbt+Configuration in order to configure sbt to correctly resolve artifacts.

The docs referenced speak to a block like this:

  my-ivy-proxy-releases: http://repo.company.com/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  my-maven-proxy-releases: http://repo.company.com/maven-releases/

This works great for sbt, but I am trying to accomplish the same in the coursier CLI (as well as in mill, which I know is outside the scope of this repo).
What would be the raw coursier configuration way to accomplish what sbt does? I'm interested both in how to do this with config files, i.e. using coursier.mirrors, using environment variables and finally using command line options.

What's of particular note is how to configure the ivy pattern in coursier as shown in sbt.

Peng Cheng
How to cs list showing all versions?
Olivier Mélois

Hey folks, I'm trying to download a binary executable from :


unfortunately, the binaries are not listed in the pom file, so setting types/classifiers in coursier dependencies is not helping. Does coursier allow for downloading a file without it being referenced in the pom ?

Olivier Mélois
(above was a user problem, no need to worry)
Chris Kipp
Inside of a DependencyTree there is a reconciledVersion and a retainedVersion. Anyone know the difference?
Chris Kipp

Alright so the above just bit me. Looking at the scaladocs I see

  /** The final version of this dependency. */
  def retainedVersion: String

which made me think I'd want that if ultimately I wanted the actual retained version, but in cases where a version range is used in Java, this still spits out the range whereas reconciled doesn't. For example

version: [2.8.6,2.9)
retrained: [2.8.6,2.9)
reconciled: 2.8.9
how come retained is still a range?
since in reality that will never be the "final" version
Tobias Roeser
Hi, how is coursier built noawdays? I can't even run the simples instructions for DEVELOP.md
Eric K Richardson
I went down that path awhile back and couldn't make progress either - if you find out please let me know here.
Tobias Roeser
Sure, but this is really frustrating. Not the first time it tried. There are also lots of issues which should at least receive some response, but nothing.
I mean, saying "I don't care", or "please can somebody else help out" is a better response than quietness.
Eric K Richardson
I totally agree man - I got no help at all - redirect/forward doesn't work with basic auth and I wanted to fix it but I could never get to a point where I could do anything. Maybe the scala-cli team could help us.

This message is replying to a Matrix event but we were unable to find associated bridged Gitter message to put it in the appropriate threaded conversation.

I get past this one.

Tobias Roeser
Reposting my build error, as it seems it didn't make it from Matix to Gitter.
17:44:11 θ60° lefou:~/work/opensource/coursier master+* 1 ± mill core.jvm[2.13.6].compile
[7/65] core.jvm[2.13.6].publishVersion 
[42/65] util.jvm[2.13.6].compile 
Compiling project (Scala 2.13.6, JVM)
Warning: 2 feature warnings; re-run with -feature for details
Error compiling project (Scala 2.13.6, JVM)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1619)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.getFileAttributes(ZipFileSystem.java:531)
        at jdk.zipfs/jdk.nio.zipfs.ZipPath.readAttributes(ZipPath.java:767)
        at jdk.zipfs/jdk.nio.zipfs.ZipPath.readAttributes(ZipPath.java:777)
        at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:276)
        at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
        at java.base/java.nio.file.Files.size(Files.java:2468)
        at sbt.internal.inc.HashUtil$.farmHash(HashUtil.scala:31)
        at sbt.internal.inc.FarmHash$.ofPath(Stamp.scala:89)
Naftoli Gugenheim

Can someone explain this?

❯ cs resolve com.zaxxer:HikariCP:4.0.0
  100.0% [##########] 25.3 KiB (316.4 KiB / s)

But https://repo1.maven.org/maven2/com/zaxxer/HikariCP/4.0.1/HikariCP-4.0.1.pom doesn't show 2.0.0-alpha1. It uses a property syntax:

Chris Kipp
@nafg: if you look at the entry for slf4j.version in the pom https://repo1.maven.org/maven2/com/zaxxer/HikariCP/4.0.0/HikariCP-4.0.0.pom it is 2.0.0-alpha1. So resolver here is showing you the fully resolved deps
Tobias Roeser
There are different property values for ${slf4j.version} in different profiles, which get auto-enabled depending on the executing Java version. Probably not the best idea, but within the Maven POM specs.
Naftoli Gugenheim
Rahul Kumar
Hi I am reading all dependencies from pom.xml using go lang and I want to download all those dependencies using coursier cli how can we do that with the help of go lang
Bjorn Regnell
Linking to scala user if someone would like to respond there to a bad install experience post:
Carlos Eduardo de Paula
Hi all, I'm installing scala tools using coursier and one of them is ammonite. when I install it using cs install ammonite, it installs the latest version but by default it install the scala 2.13 version.
I'd like to install the scala 3 version. is it possible?
I checked and there is ammonite built for all versions

Hi folks, is it possible to complete snapshots dependencies? e.g.

$ cs complete-dep -r sonatype:snapshots org.scalameta:metals_2.13:0.11.8 

At the moment it only seems to resolve releases.

Or do you recommend another way of finding out the latest snapshot version of a dependency from the terminal?

2 replies
Chris Kipp
I see you're using Metals as an example but if you're doing it for metals you can set your version in nvim-metals as latest.snapshot and it will pull it for you
or if you don't want that you can have a little script that hits https://scalameta.org/metals/latests.json which will tell you the latest versions
Zhenhao Li
hi there, can anyone tell me how to convert a value of lmcoursier.definitions.Dependency to coursier.core.Dependency?
As a beginner with this project, the purpose of lmcoursier is not very clear to me
Hi - new to Coursier and Scala! i'm looking for a self-contained example / "hello world" on Coursier using Gradle as a build tool (i have to use Gradle because it's used at my company with Java). Specifically I can use Coursier launch using say 'cs launch scala:2.13.15 -- foo.scala' and I want to know how to use 'cs launch' with Gradle.
hi again - anyone on this (Coursier and Gradle) or am i trying to match apples and pears?