I have a dependency on a file-based jar `implement...
# gradle
b
I have a dependency on a file-based jar
implementation(files("libs/slf4j-android-1.6.1-rc1.jar"))
that I want to exclude from
configuration.testImplementation { exclude("org.slf4j"}
but it doesn't seem to work. mockk is complaining that
Log.i
isn't a mock object
v
Yeah, of course it does not work, you are not depending on
org.slf4j
, you are depending on some file on your disk without any coordinates. I strongly advice against any form of
files
or
fileTree
for dependencies, those have significant drawbacks. Instead use a
flatDir
repository and then normal dependency declarations. Then - if done right - your exclude will probably also work.