1

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?

ftr
  • 2,105
  • 16
  • 29

1 Answers1

0

You can exclude transitive dependency for particular libraries using:

http://www.scala-sbt.org/0.13/docs/Library-Management.html#Exclude+Transitive+Dependencies

agulowaty
  • 191
  • 7