How to execute SBT plugin's tasks from within IntelliJ IDEA CE?

吃可爱长大的小学妹 提交于 2020-01-03 08:36:40

问题


I use IntelliJ IDEA 13.1 Community Edition with the Scala plugin 0.32.593.

What's the recommended way to execute a SBT plugin's tasks, say dependencyUpdates from sbt-updates?


回答1:


In version 15 of IntelliJ IDEA, using Scala Plugin version 2.0, you can run SBT tasks by adding a run configuration.

First add a new run configuration by clicking on Run -> Edit Configurations. Then click the + button to add a new configuration and choose SBT Task form the list

Now provide the list of tasks separated by space in Tasks input box:




回答2:


NOTE IntelliJ IDEA and the Scala and sbt plugins have improved since and you may want to read How to run sbt-assembly tasks from within IntelliJ IDEA? instead.

I worked it around with the Embedded Terminal plugin that shipped with the version of IDEA.

Alt+F12 (or Tools > Open Terminal) to open a terminal window and then sbt dependencyUpdates inside.

It does require a local installation of SBT.




回答3:


Unless there has been a recent change (in 13.1), SBT plugin doesn't support running sbt tasks.

See comments here http://blog.jetbrains.com/scala/2013/11/18/built-in-sbt-support-in-intellij-idea-13/




回答4:


You will have to run these two commands to run SBT in the terminal:

SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
java $SBT_OPTS -jar `<SBT inatall>`/bin/sbt-launch.jar "$@"


来源:https://stackoverflow.com/questions/22121939/how-to-execute-sbt-plugins-tasks-from-within-intellij-idea-ce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!