在我的Scala2.10项目中,我遇到了很多让sbt-idea工作的问题。
我尝试从它的git代码库编译sbt-idea,确保设置了
scalaVersion := "2.10.0-RC5"在build/Build.scala中,使用publish-local命令在git中编译。但我还是不断地得到
[error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected.当我随后在我的发布版本中使用它时,例如通过简单地添加
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.3.0-SNAPSHOT")添加到project/plugins.sbt文件。
发布于 2012-12-13 02:51:51
我不认为你需要为Scala2.10构建SBT。我将gen-idea和eclipse项目生成器保存在全局build.sbt文件中,它适用于我所有的项目(至少看起来是这样;-)
我使用的是Ubuntu,因此SBT配置文件在您的计算机上的保存位置可能会有所不同。
在隐藏的sbt目录下创建一个名为plugins的文件夹。在Linux上,它位于~/.sbt (其中tilde是主目录的别名)。所以现在你应该有了~/.sbt/plugins
然后在此目录下创建一个名为build.sbt的文件,并在其中添加以下内容:
resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/"
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0-SNAPSHOT")为了进行测试,我刚刚用它生成了一个Scala2.10项目,看起来还不错。
哦,如果你想生成Scala-IDE项目,上面的文件还增加了对SBT中eclipse命令的支持。
发布于 2012-12-13 02:08:33
通过在项目本身的project/plugins.sbt中添加以下内容,我能够使用旧版本的gen-idea:
import sbt._
import Defaults._
libraryDependencies += sbtPluginExtra(
m = "com.github.mpeltonen" % "sbt-idea" % "1.2.0", // Plugin module name and version
sbtV = "0.12", // SBT version
scalaV = "2.9.2" // Scala version compiled the plugin
)https://stackoverflow.com/questions/13845924
复制相似问题