Debug an sbt plugin in IntelliJ IDEA

So you have your own sbt plugin (or someone's plugin if you are not so cool and sexy) and you want to debug it. It happens that there is nothing easier than that. If you run sbt through sbt-extras script (if you don't you should) just start your test sbt app with the plugin added »