Import Dependency Management with Exclusion : <p>I have a beautiful BOM with a lot of dependencies in its dependencyManagement section and I would like to <strong>create another BOM</strong> that imports all that dependencies <strong>except one</strong>. I tried doing this:</p>

<pre><code>... in my dependencyManagement section
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
    &lt;version&gt;${spring-boot-version}&lt;/version&gt;
    &lt;type&gt;pom&lt;/type&gt;
    &lt;scope&gt;import&lt;/scope&gt;

    &lt;exclusions&gt;
        &lt;exclusion&gt;
        &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
        &lt;artifactId&gt;gson&lt;/artifactId&gt;
        &lt;/exclusion&gt;
    &lt;/exclusions&gt;
&lt;/dependency&gt;
...
</code></pre>

<p>The POM is formally correct and everything compiles. <strong>But the exclusion is simply ignored. What am I missing? Is this approach correct?</strong></p>

<p>I'm using Maven 3+.</p>
