문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.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!"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top