Installing sbteclipse
Asked Answered
H

3

15

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

Harbin answered 19/10, 2012 at 23:47 Comment(0)
L
14

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.

Lens answered 20/10, 2012 at 0:26 Comment(3)
Mine is in %USERPROFILE%\.sbt\plugins\build.sbt (not plugins.sbt) and it works OKUndershorts
You can name it anything as long as its in the plugins directory and has the extension "sbt"Lens
Mine is "~\.sbt\0.13\plugins\build.sbt". When using Version => 0.13 I think the folder is extended by the version infoCrock
B
0

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.

Boaten answered 22/5, 2015 at 12:40 Comment(0)
P
0

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.

Perk answered 8/6, 2016 at 16:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.