I have the requirement that my sbt build should fail if there are unwanted dependencies present. Concrete use case: We want to use log4j2 as logging framework und don't want any dependency to transitively include logback, commons-logging et. al.
With maven I would use the enforcer plugin, but I do not know how to do it in sbt.
My findings so far: I can exclude dependencies globally (https://github.com/sbt/sbt/pull/1748). I don't want that though, we need build failure so we notice the dependency when it is first introduced.
I also found https://github.com/CSUG/sbt-one-log, but it doesn't quite fit our requirements and doesn't seem to be actively maintained.
Before I start writing my own plugin - are there existing mechanisms to achieve this?