Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 15 23:15
    cheikh-del commented #1842
  • Jan 15 23:12
    cheikh-del commented #1842
  • Jan 15 22:24
    cchepelov commented #1948
  • Jan 15 22:22
    cchepelov edited #1948
  • Jan 15 22:09
    cchepelov synchronize #1948
  • Jan 15 16:42
    cchepelov edited #1948
  • Jan 15 16:42
    cchepelov commented #1948
  • Jan 15 16:37
    cchepelov synchronize #1948
  • Jan 15 16:33
    cchepelov synchronize #1948
  • Jan 14 22:38
    hmf edited #1947
  • Jan 14 21:18
    cchepelov edited #1948
  • Jan 14 21:11
    cchepelov synchronize #1948
  • Jan 14 21:08
    cchepelov commented #1948
  • Jan 14 20:47
    cchepelov commented #1948
  • Jan 14 20:46
    cchepelov synchronize #1948
  • Jan 14 17:25
    cchepelov opened #1948
  • Jan 14 13:36
    cchepelov commented #1421
  • Jan 12 14:57
    hmf opened #1947
  • Jan 11 21:59

    alexarchambault on gh-pages

    Update Sonatype statistics (compare)

  • Jan 11 21:59

    alexarchambault on stats

    Update Sonatype statistics (compare)

Conny Brunnkvist
@cbrunnkvist
I'm playing with cs setup - can someone explain the reason why we first download cs while the default "apps" also contains / downloads coursier and/or cs executables one more time?
Anton Sviridov
@keynmol
it's probably to treat coursier as yet another app, so that it can be updated using coursier i.e. cs update cs :)
Conny Brunnkvist
@cbrunnkvist
  Installed cs
  Installed coursier
like, yeah thanks but
There seems to be no difference, functionality-wise, between the "jar" and "native" versions I can download directly from the GH Releases page, and the ones installed by "setup"
but the sizes of the jar differ a little bit 🤔
same version reported. Strange.
Conny Brunnkvist
@cbrunnkvist
I assume the "double-download" is due to a conflation of the "update" and "install" ... but on the other hand, it prints "Checking if the standard Scala applications are installed" so uh, it should consider itself installed when e.g. cs is already in the COURSIER_BIN_DIR
Mitesh Patel
@MasterDDT
Hi, does anybody know if 2.x is backward compatible with 1.1.0? Specifically when used by pantsbuild 1.27 (it calls the command line like java -jar <coursier jar> fetch junit:junit:4.12)
1 reply
kurgansoft
@kurgansoft
Is it possible to query the latest version of an artifact with coursier?
Let's say I'm using monocle in my project, so I have it as a dependency:
com.github.julien-truffaut::monocle-core::2.0.3
Now I want to check if there is a new version of it available, but I don't want to check it manually.
Can coursier help me with that?
2 replies
Chris Kipp
@ckipp:matrix.org
[m]
I'm assuming the answer is no, but is there a way to setup an application descriptor that defaults to latest.stable but with a flag or something will pull in the latest snapshot?
basically so a user could just do the cs install metals if they want the latest stable and then cs install metals --snapshot or something of that nature for the latest nightly
3 replies
Chris Kipp
@ckipp:matrix.org
[m]
ah thanks @alexarchambault . So playing around with it and adding in sonatype:snapshots to the descriptor and then attempting to get the snapshot still doesn't work as expected. When targeting metals:latest.release it still gives me the latest stable
❯ cs launch --default-channels=false --channel ./apps/resources metals:latest.release -- -version
metals 0.9.8

# Note:
#   supported Scala versions: 0.27.0-RC1, 2.11.12, 2.12.10, 2.12.11, 2.12.12, 2.12.8, 2.12.9, 2.13.0, 2.13.1, 2.13.2, 2.13.3, 2.13.4, 3.0.0-M1, 3.0.0-M2, 3.0.0-M3
And then trying to for example target a snapshot directly gives me the following
❯ cs launch --default-channels=false --channel ./apps/resources metals:0.9.8+4-5d512f11-SNAPSHOT -- -version
Exception in thread "main" coursier.install.AppArtifacts$ScalaDependenciesNotFound: Can't find a scala version suffix for org.scalameta::metals:0.9.8+4-5d512f11-SNAPSHOT (likely a non existing module or version)
        at coursier.install.AppDescriptor.$anonfun$processDependencies$9(AppDescriptor.scala:184)
        at scala.Option.toRight(Option.scala:485)
        at coursier.install.AppDescriptor.processDependencies(AppDescriptor.scala:184)
        at coursier.cli.resolve.Resolve$.$anonfun$depsAndReposOrError$4(Resolve.scala:91)
        at scala.util.Either.flatMap(Either.scala:341)
        at coursier.cli.resolve.Resolve$.$anonfun$depsAndReposOrError$2(Resolve.scala:62)
        at scala.util.Either.flatMap(Either.scala:341)
        at coursier.cli.resolve.Resolve$.depsAndReposOrError(Resolve.scala:62)
        at coursier.cli.resolve.Resolve$.task(Resolve.scala:249)
        at coursier.cli.fetch.Fetch$.task(Fetch.scala:27)
        at coursier.cli.launch.Launch$.task(Launch.scala:453)
        at coursier.cli.launch.Launch$.run(Launch.scala:514)
        at coursier.cli.Coursier$.$anonfun$runA$2(Coursier.scala:157)
        at coursier.cli.Coursier$.$anonfun$runA$2$adapted(Coursier.scala:139)
        at coursier.cli.CommandAppPreA.run(CommandAppPreA.scala:22)
        at caseapp.core.app.CommandAppWithPreCommand.$anonfun$main$5(CommandAppWithPreCommand.scala:99)
        at caseapp.core.app.CommandAppWithPreCommand.$anonfun$main$5$adapted(CommandAppWithPreCommand.scala:99)
        at scala.util.Either.fold(Either.scala:191)
        at caseapp.core.app.CommandAppWithPreCommand.$anonfun$main$3(CommandAppWithPreCommand.scala:99)
        at caseapp.core.app.CommandAppWithPreCommand.$anonfun$main$3$adapted(CommandAppWithPreCommand.scala:85)
        at scala.Option.foreach(Option.scala:407)
        at caseapp.core.app.CommandAppWithPreCommand.main(CommandAppWithPreCommand.scala:85)
        at coursier.cli.Coursier$.main(Coursier.scala:104)
        at coursier.cli.Coursier.main(Coursier.scala)
Martijn
@martijnhoekstra:matrix.org
[m]
can I use the coursier launcher to launch a specific version of scalac?
4 replies
or the scala REPL for that matter?
I can't find it in the doc among the CLI options. Maybe I'm looking in the wrong place
Anton Sviridov
@keynmol
Moving out of the thread - the magical incantation for bootstrapping 3.0.0-M3 locally for compilation woes seems to be:
✗ cs bootstrap org.scala-lang:scala3-compiler_3.0.0-M3:3.0.0-M3 -D scala.usejavacp=true -M dotty.tools.dotc.Main -o scala_3.0.0-M3

✗./scala_3.0.0-M3 test.worksheet.sc 
-- [E007] Type Mismatch Error: test.worksheet.sc:28:14 -------------------------
28 |    forall { (bla: Int) =>
   |              ^
   |              Found:    Int => Expectations
   |              Required: Nothing => ListSuite.Prop
29 |      new Expectations {}
1 error found
Eitan Adler
@grimreaper
using the command line is it possible to resolve "latest" instead of a specific version?
Chris Kipp
@ckipp:matrix.org
[m]
yes, for example you can do the following:
cs resolve com.lihaoyi::ujson:latest.stable
com.lihaoyi:geny_2.13:0.6.2:default
com.lihaoyi:ujson_2.13:1.2.2:default
com.lihaoyi:upickle-core_2.13:1.2.2:default
org.scala-lang:scala-library:2.13.1:default
org.scala-lang.modules:scala-collection-compat_2.13:2.1.4:default
Eitan Adler
@grimreaper
@ckipp:matrix.org thanks! I could not find that anywhere in the documentation. how might i have discovered this?
Sammi
@sammi
When I run cs resolve com.google.protobuf::protobuf-java:3.0.0
it complians Can't find a scala version suffix for com.google.protobuf::protobuf-java:3.0.0 (likely a non existing module or version)
what I'm missing here?
Martijn
@martijnhoekstra:matrix.org
[m]
I think :: means it's a scala dependency, but the dependency is a java dependency instead
Does it work with : instead of ::?
Sammi
@sammi

No, not working with : ```cs resolve com.google.protobuf:protobuf-java:3.0.0
Ignoring environment variable COURSIER_REPOSITORIES, error parsing repositories from it:
Error parsing URL "https://repo1.maven.org/maven2/" (no protocol: "https://repo1.maven.org/maven2/")

https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.pom
100.0% [##########] 4.0 KiB (16.9 KiB / s)
com.google.protobuf:protobuf-java:3.0.0:default```

I tried to set maven central by COURSIER_REPOSITORIES
Sammi
@sammi
Alright, after I removed my wrong env variable set, it works now.
coursier resolve com.google.protobuf:protobuf-java:3.0.0
https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.0.0/protobuf-java-3.0.0.pom
  100.0% [##########] 4.0 KiB (10.1 KiB / s)
https://repo1.maven.org/maven2/com/google/protobuf/protobuf-parent/3.0.0/protobuf-parent-3.0.0.pom
  100.0% [##########] 6.7 KiB (142.2 KiB / s)
https://repo1.maven.org/maven2/com/google/google/1/google-1.pom
  100.0% [##########] 1.5 KiB (49.0 KiB / s)
com.google.protobuf:protobuf-java:3.0.0:default
Martijn
@martijnhoekstra:matrix.org
[m]
Glad to hear!
Damian Reeves
@DamianReeves
Hi I am trying to use coursier to connect to an internal artifactory instance, I’m trying to use the repository mirror instructions along with credentials instructions, but I’m getting a 401 from coursier… the credentials work when I use direct HTTP access
Chris Kipp
@ckipp:matrix.org
[m]
Just in case you're hitting on this coursier/coursier#1826 I've had issues getting COURSIER_CREDENTIALS to work, but they do work if you pas them directly to the command that you're using
Damian Reeves
@DamianReeves
@ckipp:matrix.org Thanks for responding but even that doesn’t work. I’ve gone as far as even putting the username and password in the mirror.properties file as part of the URL and I still get a 401.
If I do a HTTP GET myself, it works
Damian Reeves
@DamianReeves
Is there anyway to trace what coursier is doing when it does its HTTP gets?
Dmitry Voronov
@dmitry-worker
Hello everyone! I have a dumbest question but I'm not much into the plugin itself.
Consider that I have another plugin which is built on sbt-coursier 1.0.3.
The plugin requires Scala 2.11 or 2.12 IIRC
Can I build against Scala 2.13 with it?
Martijn
@martijnhoekstra:matrix.org
[m]
Sbt plugins for sbt 1.x always need to be built against 2.12.x
Dmitry Voronov
@dmitry-worker
@martijnhoekstra:matrix.org sorry, does it mean that I can't build a project on scala 2.13 with it?
Chris Kipp
@ckipp:matrix.org
[m]
no, it just means plugins themselves are built with 2.12. If you are using sbt-coursier you should be able to build a Scala 2.13 project with no issues
however, as of sbt 1.3.x coursier is included in sbt itself, so in many cases sbt-coursier is no longer needed, and you can just use normal sbt
Dmitry Voronov
@dmitry-worker
@ckipp:matrix.org many thanks!
Chris Kipp
@ckipp:matrix.org
[m]
unless you are building an actual sbt plugin, then you'll need to stick with 2.12
anirgit
@anirgit

Hello guys, I have a question on coursier resolution exception that I can't figure out a way around. I am using sbt 1.3.13 with 1.0.3 coursier plugin (not using latest coursier due to sbt/sbt#5040). My default scalaVersion is 2.12, however I am trying to compile one subproject on 2.11 only which depends on a couple of other subprojects that are cross compatible for scala 2.11 and 2.12. So it looks like --
module A (scala 2.11 only) depends on module B (supports both 2.11 and 2.12) and module C (supports both 2.11 and 2.12).
When I try sbt +module A/test:compile, everything works fine.
But when I do sbt +test:compile, I get a dependency resolution exception as --

ObjectEvent(error, TraceEvent(Error, coursier.ResolutionException: Encountered 2 error(s) in dependency resolution:
    com.org:moduleB_2.11:0.1-SNAPSHOT:
        not found:
            /home/org/.ivy2/local/com.org/moduleB_2.11/0.1-SNAPSHOT/ivys/ivy.xml
            https://repo1.maven.org/maven2/com/org/moduleB_2.11/0.1-SNAPSHOT/moduleB_2.11-0.1-SNAPSHOT.pom

com.org:moduleC_2.11:0.1-SNAPSHOT:
        not found:
            /home/org/.ivy2/local/com.org/moduleC_2.11/0.1-SNAPSHOT/ivys/ivy.xml
            https://repo1.maven.org/maven2/com/org/moduleC_2.11/0.1-SNAPSHOT/moduleC_2.11-0.1-SNAPSHOT.pom

So I am a bit baffled here is there any difference in terms of coursier resolution when just the moduleA is compiled vs all subprojects get cross compiled. What am I supposed to interpret out of this?

Tobias Roeser
@lefou

Hi, in mill we got the following issue opened lihaoyi/mill#1099:

Actually, Mill seems to pull dependencies by directly building an URL to the supposed pom. However, this method doesn't work on some repositories like for Spigot dependencies.

Mill should first pull the first maven-metadata.xml (example) at <repoUrl>/<group separated by />/<artifactId>/maven-metadata.xml to retrieve the version's metadata file (example) and get the jar name from it.

Does coursier support maven-metatdata.xml?

I opened a new discussion for that: #1945
Max
@maxstreese

Hi everyone, I got a strange resolution question. Consider the code below:

val module = mod"com.streese.registravka4s::registravka4s-core"
// val module = mod"com.sksamuel.avro4s::avro4s-core"

val res = Resolve()
  .addDependencies(Dependency(module, "latest.release"))
  .addRepositories(MavenRepository("https://packages.confluent.io/maven/"))
  .run()

When I run this for the module that is not commented out (registravka4s) I get the following error:

[error] (run-main-6) coursier.error.ResolutionError$CantDownloadModule: Error downloading com.streese.registravka4s:registravka4s-core_2.13:latest.release
[error]   No latest release version found in file:/home/max/.ivy2/local/com.streese.registravka4s/registravka4s-core_2.13/
[error]   not found: https://repo1.maven.org/maven2/com/streese/registravka4s/registravka4s-core_2.13/maven-metadata.xml
[error]   not found: https://packages.confluent.io/maven/com/streese/registravka4s/registravka4s-core_2.13/maven-metadata.xml
[error] coursier.error.ResolutionError$CantDownloadModule: Error downloading com.streese.registravka4s:registravka4s-core_2.13:latest.release
[error]   No latest release version found in file:/home/max/.ivy2/local/com.streese.registravka4s/registravka4s-core_2.13/
[error]   not found: https://repo1.maven.org/maven2/com/streese/registravka4s/registravka4s-core_2.13/maven-metadata.xml
[error]   not found: https://packages.confluent.io/maven/com/streese/registravka4s/registravka4s-core_2.13/maven-metadata.xml
[error]         at coursier.Resolve$.$anonfun$validate$1(Resolve.scala:323)
[error]         at scala.collection.immutable.List.map(List.scala:246)
[error]         at scala.collection.immutable.List.map(List.scala:79)
[error]         at coursier.Resolve$.validate(Resolve.scala:321)
[error]         at coursier.Resolve.validate0$1(Resolve.scala:115)
[error]         at coursier.Resolve.$anonfun$ioWithConflicts0$4(Resolve.scala:161)
[error]         at coursier.util.Task$.$anonfun$flatMap$extension$1(Task.scala:14)
[error]         at coursier.util.Task$.$anonfun$flatMap$extension$1$adapted(Task.scala:14)
[error]         at coursier.util.Task$.wrap(Task.scala:84)
[error]         at coursier.util.Task$.$anonfun$flatMap$2(Task.scala:14)
[error]         at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:434)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]         at java.base/java.lang.Thread.run(Thread.java:834)

However when I run the code with the other module (avro4s) then everything works as expected.

What I cannot wrap my head around is the error description which states that the file https://repo1.maven.org/maven2/com/streese/registravka4s/registravka4s-core_2.13/maven-metadata.xml does not exist but it actually does. And what is more is it looks equivalent to https://repo1.maven.org/maven2/com/sksamuel/avro4s/avro4s-core_2.13/maven-metadata.xml, as does the whole directory structure. So I do not get how registravka4s is different from avro4s here in such a way that for one the code fails and for the other it does not.

3 replies
Nishant Vishwakarma
@nishantv12

I am getting this error when trying to do sbt compile on a project

 coursier.ResolutionException: Exception during resolution
[error] Caused by: java.io.FileNotFoundException: <path to artifactory>/artifactory/typesafe-ivy-releases/org.junit.vintage/junit-vintage-engine/5.7.0/ivys/ivy.xml.sha1.lock (No such file or directory)

I am using sbt 1.3.13. I have checked and the dependency is present in the remote artifactory. The repostories configuration is proper. I am confused because I don't see an attempt to try to resolve this from the remote repository as it is not present in cache. What am I missing?

Anton Sviridov
@keynmol

If I get

Exception in thread "main" coursier.cache.ArtifactError$DownloadError: download error: Caught java.net.MalformedURLException: unknown protocol: zip+https (unknown protocol: zip+https) while downloading zip+https://github.com/sbt/sbt/releases/download/v1.4.6/sbt-1.4.6.zip!sbt/bin/sbtn-x86_64-pc-linux

when running coursier install sbtn - where should I look for issues? old coursier version? jdk issue?

Chris Kipp
@ckipp:matrix.org
[m]
Anyone have any idea if this is supposed to work coursier/coursier#1700 I just hit on this again and forgot I created an issue for it long ago