sannies / mp4parser

A Java API to read, write and create MP4 files
Apache License 2.0
2.74k stars 563 forks source link

JUnit is in the runtime classpath for the Muxer artefact #433

Open ditn opened 3 years ago

ditn commented 3 years ago

We're consuming a library that uses mp4parser under the hood.

Running ./gradlew -q app:dependencies gives us this output for our debugRuntimeClasspath:

|    |    |    +--- org.mp4parser:isoparser:1.9.41
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.24
|    |    |    \--- org.mp4parser:muxer:1.9.41
|    |    |         +--- org.mp4parser:isoparser:1.9.41 (*)
|    |    |         \--- junit:junit:4.12
|    |    |              \--- org.hamcrest:hamcrest-core:1.3

JUnit should probably not be included in your release artefacts - it increases the size of your binary and for Android consumers, it causes Leak Canary to fail to run.

For those experiencing this issue, there's a simple enough workaround:

implementation("org.mp4parser:muxer:1.9.41") {
        exclude(group = "junit", module = "junit")
}