15

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.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127

2 Answers2

9

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

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
  • 8
    Console is cool, but what about UI support? For example with maven plugin I can just select task for build and press `ctrl + shift + f10` to make a build. Is there something similar for sbt? – Cherry Aug 11 '14 at 08:47
  • 5
    I would also like to see UI support for SBT tasks. There is a "SBT Tasks" pane that takes up a lot of real estate when open, and the only thing that discernibly does anything is the "Refresh all SBT projects" button. Love the plugin, but would like to be able to double-click a command in the list and have it execute. – Brian Topping Nov 04 '14 at 16:15
8

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

jportway
  • 917
  • 8
  • 17