Maven dependency: exclude one class
You could change those classes and define them in a different jar/module which should be included as a dependency before the jar that supplies the dependency where your class to be excluded resides (Marker.class).
Maven remembers the classpath ordering from version 2.0.9.
Excluding a single class in not possible. Within <dependency>
tags you can define <exclusions/>
. However, these are for entire dependencies.
The shade plugin should be handled with care. Generally, it's not good practice to be creating a jar containing all your dependencies in one place as it tends to lead to problems if you are to be using the produced artifact in another project as a dependency. For example, shading slf4j in your jar and then depending on your artifact in another project where you have another slf4j will bring you grief.
Try it with the shade plugin
Details on why use shade and basic usage