Search code examples
scalapluginssbtsbteclipse

Global sbteclipse plugin not found/loaded


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


Solution

  • 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.