I have this dependency, I want to include this in the jar without minimizing it.
But that will exclude some important classes. So I tried to use include dependency.
But that will include all the classes.
How can I use the custom filter with code?
Or include special packages of dependency in the jar.
there are no default options to include partial set of classes from a jar (dependency).
The 2 options you have are
if this is a 'rarely' changing set of classes manually create a custom jar with the classes you need, save it local to project or in nexus and use it in the include
if this is a 'often' changing set of classes create a task, before jar and after classes, to extract the classes you need in to the build/../classes folder