1

我一直在尝试让 slick 的模式代码生成工作。这是我用来运行 slicks 代码生成器的方法以及我得到的结果。

scala>slick.codegen.SourceCodeGenerator.main(Array("slick.driver.MySQLDriver","com.mysql.jdbc.Driver","jdbc:mysql://localhost/adivinate","/Users/roy/adivinate/survey2/app/database","database","root","root"))

java.lang.NoSuchMethodError: slick.driver.JdbcProfile$API.Database()Lslick/backend/DatabaseComponent$DatabaseFactoryDef;
  at slick.codegen.SourceCodeGenerator$.run(SourceCodeGenerator.scala:65)
  at slick.codegen.SourceCodeGenerator$.main(SourceCodeGenerator.scala:94)
  ... 42 elided
scala> 

我想我错过了一个依赖,但我不知道如何找到它。这是我的 build.sbt。

name := """adivinate"""
version := "0.0.1"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.8"
incOptions := incOptions.value.withNameHashing(true)
updateOptions := updateOptions.value.withCachedResolution(cachedResoluton = true)

libraryDependencies ++= {
  val ngVersion="2.2.0"
  Seq(
    cache,
    evolutions,
    //angular2 dependencies
    "org.webjars.npm" % "angular__common" % ngVersion,
    "org.webjars.npm" % "angular__compiler" % ngVersion,
    "org.webjars.npm" % "angular__core" % ngVersion,
    "org.webjars.npm" % "angular__http" % ngVersion,
    "org.webjars.npm" % "angular__forms" % ngVersion,
    "org.webjars.npm" % "angular__router" % "3.2.0",
    "org.webjars.npm" % "angular__platform-browser-dynamic" % ngVersion,
    "org.webjars.npm" % "angular__platform-browser" % ngVersion,
    "org.webjars.npm" % "systemjs" % "0.19.40",
    "org.webjars.npm" % "rxjs" % "5.0.0-beta.12",
    "org.webjars.npm" % "reflect-metadata" % "0.1.8",
    "org.webjars.npm" % "zone.js" % "0.6.26",
    "org.webjars.npm" % "core-js" % "2.4.1",
    "org.webjars.npm" % "symbol-observable" % "1.0.1",

    "org.webjars.npm" % "typescript" % "2.1.4",

    //tslint dependency
    "org.webjars.npm" % "tslint-eslint-rules" % "3.1.0",
    "org.webjars.npm" % "tslint-microsoft-contrib" % "2.0.12",
    //   "org.webjars.npm" % "codelyzer" % "2.0.0-beta.1",
    "org.webjars.npm" % "types__jasmine" % "2.2.26-alpha" % "test",
    //test
    //  "org.webjars.npm" % "jasmine-core" % "2.4.1"

    //database dependencies
    "mysql" % "mysql-connector-java" % "5.1.30",
    //"com.typesafe.slick" % "slick_2.11" % "3.1.1", //included in play-slick
    "com.typesafe.play" %% "play-slick" % "2.0.0",
    "com.typesafe.play" %% "play-slick-evolutions" % "2.0.0",
    "com.typesafe.slick" %% "slick-codegen" % "3.0.0",
    "org.scala-lang" % "scala-reflect" % "2.12.1"
  )
}
dependencyOverrides += "org.webjars.npm" % "minimatch" % "3.0.0"


// use the webjars npm directory (target/web/node_modules ) for resolution of module imports of angular2/core etc
resolveFromWebjarsNodeModulesDir := true

// use the combined tslint and eslint rules plus ng2 lint rules
(rulesDirectories in tslint) := Some(List(
  tslintEslintRulesDir.value,
  ng2LintRulesDir.value
))

logLevel in tslint := Level.Debug
routesGenerator := InjectedRoutesGenerator


fork in run := true
4

0 回答 0