Luk*_*asz 10 intellij-idea sbt
我收到消息Expression type DslEntry must conform to Def.SettingsDefinition in SBT file,enablePlugins(JavaServerAppPackaging)我尝试刷新项目,但它没有帮助.整个sbt文件主要由lightbend(以前的类型安全)激活器生成,如下所示
import NativePackagerHelper._
name := """ping-backend"""
version := "2.4.0"
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.4.0",
"com.typesafe.play" %% "play-json" % "2.4.6",
"org.igniterealtime.smack" % "smack-java7" % "4.1.0",
"org.igniterealtime.smack" % "smack-tcp" % "4.1.0",
"org.igniterealtime.smack" % "smack-im" % "4.1.0",
"org.igniterealtime.smack" % "smack-extensions" % "4.1.0"
)
enablePlugins(JavaServerAppPackaging)
mainClass in Compile := Some("sample.hello.Main")
mappings in Universal ++= {
// optional example illustrating how to copy additional directory
directory("scripts") ++
// copy configuration files to config directory
contentOf("src/main/resources").toMap.mapValues("config/" + _)
}
// add 'config' directory first in the classpath of the start script,
// an alternative is to set the config file locations via CLI parameters
// when starting the application
scriptClasspath := Seq("../config/") ++ scriptClasspath.value
Run Code Online (Sandbox Code Playgroud)
在运行时activator run或sbt run在命令行中运行项目.我甚至可以从Intellij构建和运行它,所以这更不方便,然后是一个错误,但我仍然宁愿让它解决.有人可以帮我弄这个吗?
我通过File-> close project option 关闭了项目project/,target/并.idea/从主项目和子项目中删除了all 。然后,我重新打开intelliJ并通过File-> New- >从现有资源中的Project->从外部模型中导入项目->选择项目目录-> sbt重新导入。
我认为此问题是由于错误的导入方式引起的。正确的导入方式已将其修复。
该错误来自intellij的sbt插件https://github.com/JetBrains/intellij-sbt/blob/master/idea-plugin/src/main/scala/org/jetbrains/sbt/language/SbtAnnotator.scala#L41。
尝试这个
lazy val root = (project in file("."))
.disablePlugins(JavaServerAppPackaging)
Run Code Online (Sandbox Code Playgroud)
或这个
val foo = disablePlugins(JavaServerAppPackaging)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6062 次 |
| 最近记录: |