I am building a fat jar using maven-assembly-plugin. The jar is generated successfully. The only dependency I have for my project is: JUnit. But in the fat jar, I am unable to see this included (using jar tf command). Is JUnit dependency not included in fat jar usually ?
junit is usually a test
scoped dependency, and then it will not be included.
Dependencies with scope test
are meant to used during the build for tests, so there is no need to include them into the final JAR.
If, for some reason, you need junit in the final JAR, you need to change the scope to compile
.