Installing sbteclipse

依然范特西╮ 提交于 2019-11-30 01:13:58

问题


i have problems top use sbteclipse

What I have done:

  • went to my global sbt folder.
  • created a plugins folder
  • created the file plugins.sbt with addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
  • went to my eclipse project and created a build.sbt file
  • it contains:

name := "foo"

version := "1.0"

scalaVersion := "2.9.2"

libraryDependencies += "net.java.dev.jna" % "jna" % "3.4.0"
  • I am selecting the project folder in my cmd. and type sbt eclipse

But I always get the following error

[error] Not a valid command: eclipse (similar: help, alias)
[error] Not a valid project ID: eclipse
[error] Expected ':'
[error] Not a valid key: eclipse (similar: deliver, licenses, clean)
[error] eclipse
[error]        ^

ps: I am using Windows. I am also using sbt 0.12


回答1:


Your global sbt folder is at %USERPROFILE%\.sbt (C:\Users\<username>\.sbt most likely). So your plugins should be defined at %USERPROFILE%\.sbt\plugins\plugins.sbt

Failing this you can add it to your project directly. Add the file path is <project_root>\project\plugins.sbt. If the project directory doesn't exist you will need to create it.




回答2:


I think that I might have found a solution. First, the default directory checked for plugins configuration is 'USER_HOME/.sbt/plugins' and NOT 'USER_HOME/.sbt/0.13/plugins'.

Secondly, the sbt version specified seems to matter. In 'PROJECT_HOME/project/build.properties', there's an 'sbt.version' property. If the version of sbt specified in this file is different from the actually installed version of sbt, there's likely to be an issue. I think I was affected more so by this because I'm using an Activator template and it already had 'sbt.version' specified in this 'build.properties' file.

While nosing around, I came across this

"Support for plugin configuration in project/plugins/ has been removed. It was deprecated since 0.11.2" from sbt website at http://www.scala-sbt.org/0.13.0/docs/Community/ChangeSummary_0.13.0.html. I still see a lot of guys pointing that it should be configured in 'PROJECT_HOME/projects/plugins.sbt'. I think this is very confusing.




回答3:


I had similar a issue and answered to a similar question.

I tried "everything" and, eventually, I just had to update my sbt from 0.13.1 to 0.13.9.



来源:https://stackoverflow.com/questions/12983900/installing-sbteclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!