1

我正在尝试使用 ensime-sbt 插件在 Lagom 1.4.4 项目上创建 ensime 配置文件。但是,在ensimeConfig我的项目的根目录上运行命令时,我收到此错误:

> ensimeConfig [info] ENSIME update.
[info] Resolving com.lightbend.lagom#lagom-reloadable-server_2.12;1.4.4 ... 
[info] ENSIME processing lagom-internal-meta-project-service-locator (lagom-internal-meta-project-service-locator)
[error] Missing setting: ensimeScalacTransformer
[trace] Stack trace suppressed: run last my-project/*:ensimeConfig for the full output.
[error] (my-project/*:ensimeConfig) java.lang.IllegalArgumentException 
[error] Total time: 56 s, completed Jun 12, 2018 7:37:12 PM

该项目似乎lagom-internal-meta-project-service-locator是由 Lagom 插件在构建时动态创建的,因为它位于target/lagom-dynamic-projects下。此外,编码似乎不需要它。所以我认为最好的方法是忽略文件夹target/lagom-dynamic-projects下的所有项目。

运行时如何忽略文件夹下的所有项目ensimeConfig

4

2 回答 2

0

Hüseyin 提出的解决方案是一个起点,但并没有完全解决问题。通过将它添加到我的 build.sbt(或 $HOME/.sbt/1.0/global.sbt,如果您不想直接在项目中使用),我设法让 ensime 与 Lagom 一起工作。

import org.ensime.EnsimeKeys._
import org.ensime.EnsimePlugin

ensimeIgnoreMissingDirectories := true

ensimeIgnoreScalaMismatch in ThisBuild := true
ensimeScalaVersion in ThisBuild := "2.12.6"

lazy val serviceLocatorProject = ProjectRef(uri("."), "lagom-internal-meta-   project-service-locator")
ensimeUnmanagedSourceArchives in serviceLocatorProject := Nil
ensimeUnmanagedJavadocArchives in serviceLocatorProject := Nil
ensimeScalacTransformer in serviceLocatorProject := identity
ensimeScalacOptions in serviceLocatorProject := EnsimePlugin.ensimeSuggestedScalacOptions(scalaVersion.value)
ensimeJavacOptions in serviceLocatorProject := Nil

lazy val cassandraProject = ProjectRef(uri("."), "lagom-internal-meta-project-cassandra")
ensimeUnmanagedSourceArchives in cassandraProject := Nil
ensimeUnmanagedJavadocArchives in cassandraProject := Nil
ensimeScalacTransformer in cassandraProject := identity
ensimeScalacOptions in cassandraProject := EnsimePlugin.ensimeSuggestedScalacOptions(scalaVersion.value)
ensimeJavacOptions in cassandraProject := Nil

lazy val kafkaProject = ProjectRef(uri("."), "lagom-internal-meta-project-kafka")
ensimeUnmanagedSourceArchives in kafkaProject := Nil
ensimeUnmanagedJavadocArchives in kafkaProject := Nil
ensimeScalacTransformer in kafkaProject := identity
ensimeScalacOptions in kafkaProject := EnsimePlugin.ensimeSuggestedScalacOptions(scalaVersion.value)
ensimeJavacOptions in kafkaProject := Nil
于 2018-09-29T09:31:11.120 回答
0

Lagom 和 ensime 不顺利,但您可以尝试将其添加到您的 sbt 文件中:

lazy val serviceLocatorProject = ProjectRef(uri("."), "lagom-internal-meta-project-service-locator")
ensimeUnmanagedSourceArchives in serviceLocatorProject := Nil
ensimeUnmanagedJavadocArchives in serviceLocatorProject := Nil

您可能需要对任何其他内部连接器等执行此操作,例如lagom-internal-meta-project-cassandralagom-internal-meta-project-kafka

于 2018-06-18T14:22:03.910 回答