How to run sbt-assembly tasks from within IntelliJ IDEA?
Solution 1
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
Solution 2
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.
Related videos on Youtube
MaatDeamon
Updated on July 09, 2022Comments
-
MaatDeamon almost 2 years
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.
-
Cherry over 9 yearsConsole 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? -
Brian Topping over 9 yearsI 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.