I want to exclude a direct dependency of a Maven plugin and the approach described in this answer does not work (as indicated by this comment).
As a particular examp
Check your dependency list with dependency:tree and solve WTF lib is introducing that lib dependency, then exclude in it. Maybe you dependency couldn't be direct one.
I hope to help u.
Edit: Just follow your dependency hierarchy