You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "Seth Fitzsimmons (Jira)" <ji...@apache.org> on 2022/12/07 21:54:00 UTC
[jira] [Created] (SEDONA-210) 1.3.0-incubating doesn't work with Scala 2.12 sbt projects
Seth Fitzsimmons created SEDONA-210:
---------------------------------------
Summary: 1.3.0-incubating doesn't work with Scala 2.12 sbt projects
Key: SEDONA-210
URL: https://issues.apache.org/jira/browse/SEDONA-210
Project: Apache Sedona
Issue Type: Bug
Reporter: Seth Fitzsimmons
`org.apache.sedona:sedona-common@1.3.0-incubating` ([direct Maven link](https://repo1.maven.org/maven2/org/apache/sedona/sedona-common/1.3.0-incubating/)) is only built for Scala 2.13.x and doesn't include the Scala version suffix. This is problematic due to the inclusion of `org.scala-lang.modules:scala-collection-compat`, which targets specific Scala versions differently. As a result, `sbt` fails to build projects against Scala 2.12 with this error:
```
2022.12.07 21:46:49 INFO [error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/path/to/project/"), "project"):
2022.12.07 21:46:49 INFO [error] org.scala-lang.modules:scala-collection-compat _2.12, _2.13
```
The relevant part of the offending `build.sbt` looks like this:
```scala
scalaVersion := "2.12.17"
val SedonaVersion = "1.3.0-incubating"
val ScalaCompatibleVersion = "2.12"
libraryDependencies ++= Seq(
"org.apache.sedona" %% f"sedona-core-${SparkCompatibleVersion}" % SedonaVersion,
"org.apache.sedona" %% f"sedona-sql-${SparkCompatibleVersion}" % SedonaVersion
)
```
I was able to work around this by explicitly depending on the correct version of `org.scala-lang.modules:scala-collection-compat@2.9.0` and excluding the wrong cross-versioned one:
```scala
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.9.0",
"org.apache.sedona" %% f"sedona-core-${SparkCompatibleVersion}" % SedonaVersion, // exclude("org.scala-lang.modules", "scala-collection-compat_2.13"),
"org.apache.sedona" %% f"sedona-sql-${SparkCompatibleVersion}" % SedonaVersion exclude("org.scala-lang.modules", "scala-collection-compat_2.13")
)
```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)