java - How to exclude test dependencies from a shaded maven jar? -


i'm using maven-shade-plugin , i'd exclude not test code, test dependencies in shaded jar. realize can exclude artifacts (like junit), that's bit of work , prone error likely.

i'm setting minimizejar true, still see junit , mockito dependencies showing up. there no way exclude test scoped dependencies via configuration?

make sure test dependencies in test scope:

<dependencies>     <dependency>         <groupid>junit</groupid>         <artifactid>junit</artifactid>         <version>4.11</version>         <scope>test</scope>     </dependency> ... 

to check if dependency setup use

mvn dependency:tree 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -