Maven dynamically exclude class with same name from different dependencies
<p>There are two classes <code>com.package.A</code>, one coming from</p>

<pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.package&lt;/groupId&gt;
    &lt;artifactId&gt;art1&lt;/artifactId&gt;
&lt;/dependency&gt;
</code></pre>

<p>and one coming from</p>

<pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.package&lt;/groupId&gt;
    &lt;artifactId&gt;art2&lt;/artifactId&gt;
&lt;/dependency&gt;
</code></pre>

<p>Notice that the artifact ids are different.</p>

<p>For different Maven profiles, I want to exclude one version and just keep the other version. I am using the Shade Plugin.</p>