Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run SBT Task from Eclipse

I am using SBT as a build manager, and Eclipse as my IDE, or at least I want to. The problem is more, how do I run specific SBT tasks from Eclipse. I have properly exported the project to Eclipse, and Eclipse is very helpful while writing the code, but how can I use Eclipse as a frontent for SBT. How can I start an SBT run command from eclipse? How can I start an SBT test command?

like image 422
Arne Avatar asked Mar 19 '12 22:03

Arne


2 Answers

Unfortunately, at the moment, there is no integration of SBT in eclipse. The sole plugin that goes in that direction seems abandoned and is quite useless: http://www.assembla.com/spaces/sbt-eclipse-integration/wiki

A solution is to integrate a terminal into eclipse to run sbt command. If you want to do it, the documentation is here: Is there an Eclipse plugin to run system shell in the Console?

If you are open to other IDE, and if integration is mandatory for you, you can use IDEA and its SBT plugin: https://github.com/orfjackal/idea-sbt-plugin

As far as I'm concerned, I keep using a shell window beside my eclipse, using key shortcut to switch between them.

like image 81
Nicolas Avatar answered Nov 17 '22 15:11

Nicolas


At of today I managed to launch sbt as as external tool in eclipse on Windows. This was straightforward apart from having to guess an undocumented jline property

-Djline.WindowsTerminal.directConsole=false

Pressing enter after typing a command does nothing unless this property is set.

For reference purposes, this is with mostly current versions of everything:

  • Windows 7 x64
  • Eclipse 4.3.1
  • Scala IDE 4.0.0m1
  • sbt 0.13.0

The run configuration looks like this: eclipse run config screenshot

HTH

like image 44
Thomas Dufour Avatar answered Nov 17 '22 16:11

Thomas Dufour