scalasbt

sbt plugin resolvers not adding sbtVersion, scalaVersion to artifactory url


In an sbt project, I'm adding some plugins, like

addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.2")

This should resolve to an artifact url similar to this:

https://repo1.maven.org/maven2/org/typelevel/sbt-tpolecat_2.12_1.0/0.5.2/sbt-tpolecat_2.12_1.0-0.5.2.pom

But instead it is trying this url and fails:

[error] Error downloading org.typelevel:sbt-tpolecat;sbtVersion=1.0;scalaVersion=2.12:0.5.2
[error]   not found: https://repo1.maven.org/maven2/org/typelevel/sbt-tpolecat/0.5.2/sbt-tpolecat-0.5.2.pom

This is with Java 21.0.7, Scala 3.6.1 and sbt 1.11.2 on MacOS.


Solution

  • Turns out that I run a scala-cli command some days ago to set the default repository to some internal url... something like:

    scala-cli config --power repositories.default https://<internal_url>
    

    For some reason that seems to mess with the resolver pattern, and also messed with the repository mirrors. I went to the actual config file at ~/Library/Application Support/ScalaCli/secrets/config.json and commented out the setting, that fixed it.