Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
992 views
in Technique[技术] by (71.8m points)

scala - Intellij sbt sbt-native-packager and enablePlugins error

I have an sbt build that works when I run from the command line, but that Intellij does not like. My Intellij is running on Linux, its version is 14.1.4, my scala plugin is 1.5.2.

Intellij complains about my use of enablePlugins(JavaAppPackaging). The error is "Expression Type (DslEntry) must conform to Setting[_] in SBT file".

My project/build.properties file:

sbt.version=0.13.8

My project/plugins.sbt

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.3")

And the first few lines of my build.sbt

enablePlugins(JavaAppPackaging)

organization := "org.bodhi"

name := "jar-patch"

version := "1.0"
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The answer by @lifeGoGoGo on another thread Intellij IDEA and SBT syntax error works for me (on Ubuntu, setting the custom sbt-launcher.jar in global settings and project settings of IntelliJ IDEA - as sensibly answered by @Mustafa on this thread - wasn't enough, but then adding the "lazy val" tactic was enough). So for example, this worked for me in build.sbt (obviously you change your plugin-details to suit what you are doing, as this issue is caused by IntelliJ and not by the specific plugin you want to enable):

lazy val root = (project in file(".")).
  enablePlugins(ScalaJSPlugin).
  settings(
    name := "Scala.js Tutorial",
    scalaVersion := "2.11.7",
    version := "1.0"
  )

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...