1

I am having some serious difficulty installing sbteclipse as a global plugin. It seams like the global plugins are not being loaded. I created the .sbt directory and added a plugins directory. In the plugins directory I added the following build.sbt definition:

resolvers += Classpaths.typesafeSnapshots

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-SNAPSHOT")

the above definition is in the ~/.sbt/plugins directory. When I search online I see plenty of sbt startups that look like the following: (notice the global plugin load and the project definition path)

sbt startup example

Now here is an example of my sbt startup and my attempt to run eclipse:

my sbt startup

Any thoughts on what I am doing wrong. I have been working on this for hours.

EDIT:

The error I get for not running sbt as superuser:

> mkemnetz@ubuntu:~/git/GymWebApp$ sbt
bash: /bin/sbt: Permission denied
mkemnetz@ubuntu:~/git/GymWebApp$

EDIT2:

mkemnetz@ubuntu:~/git/GymWebApp$ sbt
[info] Loading global plugins from /home/mkemnetz/.sbt/plugins
[info] Set current project to default-18287a (in build file:/home/mkemnetz/git/GymWebApp/)
> eclipse
[info] About to create Eclipse project files for your project(s).
[error] java.io.FileNotFoundException: /home/mkemnetz/git/GymWebApp/target/streams/$global/project-descriptors/$global/out (Permission denied)
[error] Use 'last' for the full log.

This is the current error I am getting. Still not working but much improved thanks to darwin

Matthew Kemnetz
  • 845
  • 1
  • 15
  • 28
  • 1
    According to info from edit 2 you need to remove target directory, that was created by superuser. sudo rm -rf /home/mkemnetz/git/GymWebApp/target . And then run 'sbt eclipse' again – viktortnk Apr 02 '12 at 04:07
  • @darwin can you possibly edit your old answer or write a new one with the info you gave me in the comments so I could then accept the answer. You have been incredibly helpful. Everything works excellently now. – Matthew Kemnetz Apr 02 '12 at 04:13

3 Answers3

1

Instead of build.sbt in my ~/.sbt/plugins dir I have plugins.sbt with the content like in your example. And everything works fine for me.

UPD:

The problem occurs because of you run sbt command under superuser's environment so sbt conf is not resolved properly.

Just run sbt under your user after removing project target dir.

viktortnk
  • 2,739
  • 1
  • 19
  • 18
0

This is my ~/.sbt/plugins/build.sbt:

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0")

Ngoc Dao
  • 1,501
  • 3
  • 18
  • 27
0

Quoting sbteclipse github

For sbt 0.13 and up Add sbteclipse to your plugin definition file. You can use either: the global file (for version 0.13 and up) at ~/.sbt/0.13/plugins/plugins.sbt the project-specific file at PROJECT_DIR/project/plugins.sbt

AND I want to comment on this "backward compatibility is very important!"

zinking
  • 5,561
  • 5
  • 49
  • 81