In a Play! app (Play 2.3), sometimes I see a plugin enabled by adding an
addSbtPlugin entry in file
project/plugins.sbt. For other plugins that I made by extending the Plugin trait, I have to add a
conf/play.plugins file to register the plugins. Are these 2 ways to achieve the same thing, or the plugins declared in
plugins.sbt are fundamentally different from those that extend
Best How To :
plugins.sbt are plugins for your build, ie, for sbt. They get loaded and run by sbt when you build your app. For example, the sbt less plugin compiles less files at build time. When you deploy your app, the less plugin is not needed, because the less files have already been compiled into css files.
play.plugins are plugins for your application when it's running. For example, if you have a database plugin of some sort, it needs to be loaded and run by play when your app runs. It's not needed at build time, because you don't connect to your database when you build your app.
So, they are fundamentally different, loaded by different things, implementing different interfaces, etc.