Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run sbt-assembly tasks from within IntelliJ IDEA?

Is it possible to run sbt-assembly from within IntelliJ IDEA?

Also I read in the doc that one could add task within the SBT Tool window. But what I see is that it only helps you view your project not task? I cannot add any tasks there. How does the Tool window work exactly?

I have the last version of IntelliJ IDEA.

like image 540
MaatDeamon Avatar asked Aug 03 '14 23:08

MaatDeamon


2 Answers

You can find the SBT plugin useful for your needs. With it, you can execute any tasks or command available in your build so sbt-assembly ones should work, too.

The plugin gives you SBT Console in which you start a sbt shell as if you were running it on the command line. The plugin gives you a more IDEA-like environment to work with the interactive console.

enter image description here

like image 69
Jacek Laskowski Avatar answered Oct 07 '22 17:10

Jacek Laskowski


This answer is now out-of-date. IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by :

  • choosing "Edit configurations" from the "Run" menu (or the toolbar popup)
  • click the "+" button to add a configuration and select "SBT Task" as the type of configuration you want to make.
  • fill out the details such as the name of the task and the working directory if necessary

You can now run the task in the same way as any other run configuration; select it in the run configuration popup in the toolbar and click the run button (or if you're one of those keyboard-only people press shift-ctrl-r and select the task from the popup that appears)

official documentation here : https://www.jetbrains.com/help/idea/2016.2/run-debug-configuration-sbt-task.html

like image 38
jportway Avatar answered Oct 07 '22 16:10

jportway