I'm using the maven-shade-plugin and I'd like to exclude not only my test code, but my test dependencies in the shaded jar. I realize I can specifically exclude certain artifacts (like junit), but that's a good bit of work and prone to some error most likely.
I'm setting minimizeJar
to true, but I still see my Junit and Mockito dependencies showing up. Is there just no way to exclude all test scoped dependencies via configuration?
Make sure your test dependencies in the test
scope:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
...
To check if your dependency setup use
mvn dependency:tree
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With