tl;dr You can't have a plugin project and be able to test it out without another project that uses it.
A plugin enhances a build definition of a project so you set up a plugin that expands the project with capabilities you want - additional settings and tasks. See Plugins in the official documentation of sbt.
You set up plugins in meta-project under project
directory, by convention usually in project/plugins.sbt
(but any project/*.sbt
file would do).
If you need to test a plugin you've got two notable choices that all boil down to having a separate project for the plugin and another to use it - the choice is about the place where the test project is as compared to the plugin project under test.
Plugin project in project
metaproject
You can have the sources of the plugin under project/src/main/scala
so they belong to their own project, but because of the directory they live in project
, they automatically become part of the metaproject for another project one level up.
With the plugin's sources inside the meta-project project
you can define a plugin dependency in project/plugins.sbt
and have the plugin installed (given the recent changes to sbt since 0.13.5 it doesn't necessarily mean the plugin's enabled).
Plugin project anywhere
The plugin project is a sbt project and as such can be referenced from another sbt project using ProjectRef
. If it's a git://
or file://
project, you declare the dependency on the plugin project using dependsOn
and the project reference with ProjectRef
.
See Can multi-projects from GIT be used as SBT dependencies? and How can sbt pull dependency artifacts from git?.