Defining plugin dependency between subprojects in SBT?

sbt

Solution

As Jacek said, it cannot be done as I would like, as a subproject cannot have a SBT plugin that the root project does not. On the other hand, this discussion on the mailing list contains several alternatives, and would no doubt be useful to anyone who comes across this question in the future.

EDIT: Well, in the end the alternatives mentioned (sbt scripted, etc) were hard and clunky to use. My final solution was to just have a separate project (not subproject) inside the repo that depends on the original project via it's ivy coordinates, and using bash to publishLocal the first project, going into the second project and running its tests

sbt publishLocal; cd test; sbt test; cd ..

I always thought the point of something like SBT was to avoid doing this kind of bash gymnastics, but desperate times call for desperate measures...

Problem

EDIT: Since I put up the bounty, I thought I should restate the question How can a SBT project `P`, with two sub-projects `A` and `B`, set up `B` to have a plugin dependency on `A`, which is a SBT plugin? - Giving `P` a plugin dependency on `A` does not work, since `A` depends on other things in `P`, which results in a circular dependency graph - It has to be a plugin dependency, for `A` is a plugin needed to run `B`s test suite. - `dependsOn` doesn't work, because, well, it has to be a plugin dependency I'd like to know either of - How to do this, or - Why this is impossible, and what the next best alternatives are. EDIT: clarified that it's a plugin-dependency, since build-dependency is ambiguous

Original source

Related problems