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?
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.
sbt
commands are typically few and far between, so Eclipse integration isn't in high demand. Especially with, e.g., the play 2.0 framework, you just open a terminal and sbt run, and leave it running as you develop. –
Pasadena -Djline.WindowsTerminal.directConsole=false
, as in my answer below. –
Zola 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:
HTH
© 2022 - 2024 — McMap. All rights reserved.