我有一个scala play应用程序,我正在尝试使用sbt shell进行编译
我的build.sbt文件如下
Task exception was never retrieved
future: <Task finished coro=<AsyncTransport.main_loop() done, defined at /path/to/PythonElasticsearchIngest/venv/lib/python3.6/site-packages/elasticsearch_async/transport.py:143> exception=RuntimeError('Task got bad yield: 200',)>
Traceback (most recent call last):
File "/path/to/PythonElasticsearchIngest/venv/lib/python3.6/site-packages/elasticsearch_async/transport.py", line 150, in main_loop
method, url, params, body, headers=headers, ignore=ignore, timeout=timeout)
但是,在编译过程中,我不断遇到错误
name := """template-service"""
version := "2.6.x"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.12.4"
crossScalaVersions := Seq("2.11.12", "2.12.4")
libraryDependencies += guice
libraryDependencies += "com.typesafe.play" %% "play-slick" % "3.0.3"
libraryDependencies += "com.typesafe.play" %% "play-slick-evolutions" % "3.0.3"
libraryDependencies += "com.h2database" % "h2" % "1.4.196"
libraryDependencies += specs2 % Test
resolvers += Resolver.url("bintray-sbt-plugins", url("https://dl.bintray.com/sbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1")
我尝试重新启动sbt shell并重复上述过程,并始终得到错误。有人可以让我知道build.sbt文件中缺少的内容吗?是某种需要添加的配置设置吗?
任何指针都将非常有帮助。在此先感谢!!!
答案 0 :(得分:2)
您应该将播放插件带入project/plugins.sbt
中:
在项目目录的project
目录中,创建一个名为plugins.sbt
的文件,并将其添加到其中:
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0")
其中添加了play sbt插件(特别是play 2.7.0-如果需要,请使用其他版本)。
然后在您的sbt shell中键入reload
以重新启动该shell。