4

Exactly what the title says.

I've inherited a legacy project using gradle and the interdependence of modules is giving me a headache. Is there a plugin/process/black magic that'll fail the build on unused dependencies?

harmingcola
  • 454
  • 6
  • 17
  • 6
    possible duplicate of [How to find\remove unused dependencies in gradle](http://stackoverflow.com/questions/19379517/how-to-find-remove-unused-dependencies-in-gradle) –  Sep 23 '15 at 15:55
  • I'll give that a bash – harmingcola Sep 23 '15 at 15:56

1 Answers1

2

Not a direct answer, but closely related.

With DepClean, you can break a Maven build if there are unused dependencies

See https://github.com/ASSERT-KTH/depclean

Martin Monperrus
  • 1,845
  • 2
  • 19
  • 28
  • There is also a `depclean-gradle-plugin` in the GitHub repo, currently not available from Maven Central but can be built from source. It has a Gradle task called `depclean` which supports boolean parameters `failIfUnusedDirect`, `failIfUnusedTransitive`, and `failIfUnusedInherited`. – cesarsotovalero Jun 04 '23 at 08:43