绝对是Scala的初学者。我在macOS X中安装了Scala2.12.1。
我正在尝试设置来自here的sample computer-database Play-Slick sample
一旦我用cd进入计算机数据库,我就运行sbt run,结果是这个错误:
error: not found: value PlayKeys "PlayKeys.playOmnidoc := false"以下是文件夹根目录下build.sbt的默认内容:
name := "computer-database-sample"
PlayKeys.playOmnidoc := false在调用PlayKeys之前,我尝试向build.sbt添加以下代码行,以显式导入play-slick:
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "2.0.0",
"com.typesafe.play" %% "play-slick" % "0.6.0.1",
"com.typesafe.slick" %% "slick-extensions" % "3.1.0"
)但我仍然收到相同的错误。
我错过了什么吗?这是scala项目应该如何设置的吗?
发布于 2017-01-13 16:51:01
停止你正在做的任何修改,恢复它们(你需要有来自repo的干净版本)。
执行以下操作(不是最快的root,而是允许您在进行过程中探索其他次要内容的root):
1)进入repo根目录。
2)类型:sbt -i不起作用,请先安装sbt
3)在成功的第2点之后,您应该会看到以下内容:
[pdolega@maracuja play-slick]$ sbt
[info] Loading project definition from /home/pdolega/projects/slick/play-slick/project
[info] Compiling 1 Scala source to /home/pdolega/projects/slick/play-slick/project/target/scala-2.10/sbt-0.13/classes...
Missing bintray credentials /home/pdolega/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /home/pdolega/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /home/pdolega/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /home/pdolega/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /home/pdolega/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /home/pdolega/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to play-slick-root (in build file:/home/pdolega/projects/slick/play-slick/)4)类型:projects。您将看到所有的sbt子项目:
> projects
[info] In file:/home/pdolega/projects/slick/play-slick/
[info] basic-sample
[info] computer-database-sample
[info] docs
[info] iteratee-sample
[info] play-slick
[info] play-slick-evolutions
[info] * play-slick-root
[info] samples
> 4)键入project computer-database-sample <-这将激活所需的子项目。
> project computer-database-sample
[info] Set current project to computer-database-sample (in build file:/home/pdolega/projects/slick/play-slick/)
[computer-database-sample] $5)现在您可以安装do test,它将运行编译和之后的所有测试。或者,您可以键入run来启动此示例播放应用程序。
[computer-database-sample] $ run
[warn] Credentials file /home/pdolega/.bintray/.credentials does not exist
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)https://stackoverflow.com/questions/41625862
复制相似问题