Search code examples
scalaslicksqueryldata-persistence

Scala and persistence framework version incompatible


I try to use slick and squeryl framework for data persistence with scala. I don't want to use Play framework, but just the persistence framework, but when I import slick (or squeryl) jar file, I encountered the issue below:

slick_2.10.1-2.0.0-M1.jar of <project_name> build path is cross-compiled with an incompatible version of Scala (2.10.1). In case this report is mistaken, this check can be disabled in the compiler preference page.   

I used scala jar (2.11.6) under scala plugin on Eclipse, and I can run simple scala application. I can also get access to mysql dbms with jdbc. This problem appears when I import the slick (or squeryl) jar files. Is it because the framework does not support scala 2.11? Is downgrade scala version the solution? If so, can anyone point me a direction on how to downgrade the scala version under Eclipse scala plugin. Thank you very much


Solution

  • If you are using scala 2.11 you need to use this dependency for slick:

    <dependency>
      <groupId>com.typesafe.slick</groupId>
      <artifactId>slick_2.11</artifactId>
      <version>3.0.0</version>
    </dependency>