SORM: How to use Sorm in Scala 2.11.6
How can I use Sorm in Scala 2.11.6, in compilation I get the following errors
[error] Modules were resolved with conflicting cross-version suffixes in ...
[error] org.scala-lang.modules:scala-xml _2.11, _2.12.0-M1
[error] org.scala-lang.modules:scala-parser-combinators _2.11, _2.12.0-M1
in my build.sbt I am using ...
name := "api-psi"
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
"com.h2database" % "h2" % "1.4.177",
"org.sorm-framework" % "sorm" % "0.3.18",
"org.webjars" % "bootstrap" % "3.3.5",
specs2 % Test
)
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
routesGenerator := InjectedRoutesGenerator
I try this example: https://www.youtube.com/watch?v=eNCerkVyQdcI but it never imported sorm ...
People, I managed to solve ...
To clear up the inconsistency, you must clear the ivy cache:
~/.ivy2/cache
However, you also want to fix the version of using the scala compiler, and you want it to match your configured scalaVersion:
dependencyOverrides += "org.scala-lang" % "scala-compiler" % scalaVersion.value
Now on my SBT
name := """api-my-psi"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
specs2 % Test,
"org.sorm-framework" % "sorm" % "0.3.18",
"org.webjars" % "webjars-play_2.11" % "2.4.0-1",
"org.webjars" % "bootstrap" % "3.3.5"
)
dependencyOverrides += "org.scala-lang" % "scala-compiler" % scalaVersion.value
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
routesGenerator := InjectedRoutesGenerator
source to share
I think the problem is with the line
"org.scala-lang"% "scala -library"% "2.11.6"
remove it because the scala version shoul is in your sbt like this:
name := "your name app"
version := "your version"
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
"org.sorm-framework" % "sorm" % "0.3.18"
)
I am creating a new play app with an activator as it is rendered using the play framework. This adds a dependency for sorm :, also delete files inside .ivy / cache, maybe this is some kind of dependency on an online dependent dependency,
I also think the problem is with webjars dependency which is specific to scala 2.11, I did this compilation with java 8, but in this case it doesn't matter. It is important that this is the scala version for your depend on this:
name := """TestStackOverflow"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.6"
libraryDependencies ++= Seq(
jdbc,
cache,
ws,
specs2 % Test,
"org.sorm-framework" % "sorm" % "0.3.18",
"org.webjars" % "webjars-play_2.11" % "2.4.0-1",
"org.webjars" % "bootstrap" % "3.3.5"
)
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator
source to share