com-lihaoyi / scalasql

Scala ORM to query SQL databases from Scala via concise, type-safe, and familiar case classes and collection operations. Connects to Postgres, MySql, H2, and Sqlite out of the box
195 stars 22 forks source link

Invalid published scalasql-core POM file (Error resolving scalasql_2.13 0.1.0) #6

Closed aboisvert closed 7 months ago

aboisvert commented 7 months ago

I added the scalasql dependency to my sbt build,

    libraryDependencies ++= Seq(
      "com.lihaoyi" % "scalasql_2.13" % "0.1.0",
      ...
   )

And when SBT tries to resolve it, I get the following error:

sbt:webapp> compile
[info] Updating 
https://repo1.maven.org/maven2/com/lihaoyi/scalasql_2.13/0.1.0/scalasql_2.13-0.1.0.pom
  100.0% [##########] 2.5 KiB (8.5 KiB / s)
https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-slf4j-impl/2.20.0/log4j-slf4j-impl-2.20.0.pom
  100.0% [##########] 7.5 KiB (78.9 KiB / s)
https://repo1.maven.org/maven2/com/lihaoyi/scalasql-operations_2.13/0.1.0/scalasql-operations_2.13-0.1.0.pom
  100.0% [##########] 1.6 KiB (14.2 KiB / s)
https://repo1.maven.org/maven2/com/lihaoyi/scalasql-query_2.13/0.1.0/scalasql-query_2.13-0.1.0.pom
  100.0% [##########] 1.6 KiB (6.3 KiB / s)
https://repo1.maven.org/maven2/com/lihaoyi/scalasql-core_2.13/0.1.0/scalasql-core_2.13-0.1.0.pom
  100.0% [##########] 2.2 KiB (17.5 KiB / s)
[info] Resolved  dependencies
[warn] 
[warn]  Note: Unresolved dependencies path:
[error] stack trace is suppressed; run last update for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.scala-lang:scala-reflect:scalasql[2.13.12].scalaVersion
[error]   Not found
[error]   Not found
[error]   not found: /home/boisvert/.ivy2/local/org.scala-lang/scala-reflect/scalasql[2.13.12].scalaVersion/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/scalasql[2.13.12].scalaVersion/scala-reflect-scalasql[2.13.12].scalaVersion.pom
[error] Total time: 1 s, completed Apr 5, 2024, 6:36:08 PM

Indeed when inspecting the scalasql-core POM file at https://repo1.maven.org/maven2/com/lihaoyi/scalasql-core_2.13/0.1.0/scalasql-core_2.13-0.1.0.pom it looks like it contains the following ill-formed dependency:

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-reflect</artifactId>
            <version>scalasql[2.13.12].core.scalaVersion</version>
        </dependency>
aboisvert commented 7 months ago

Temporary workaround is to pin scala-reflect to a fixed version which prevents resolving the invalid version:

    libraryDependencies ++= Seq(
      "com.lihaoyi" % "scalasql_2.13" % "0.1.0",

      // override scala-reflect due to invalid published scalasql-core pom
      // https://github.com/com-lihaoyi/scalasql/issues/6
      "org.scala-lang" % "scala-reflect" % "2.13.13",
      ...
    )
lihaoyi commented 7 months ago

Should be fixed by https://github.com/com-lihaoyi/scalasql/commit/e05cf3039ed8c72373cb4a7896a5d9e866154f40, which I tagged as 0.1.1