title: Exclude dependency from pom using Maven Publish Plugin?
body: <p>I use the following plugins:</p>
  <pre><code>id 'maven-publish'
  id &quot;com.github.johnrengelman.shadow&quot; version &quot;7.0.0&quot;
  </code></pre>
  <p>my dependencies:</p>
  <pre><code>dependencies {
      shadow gradleApi()
      shadow localGroovy()
      implementation 'com.example:lib:0.1.0'
  </code></pre>
  <p>my publishing block:</p>
  <pre><code>publishing {
      publications {
          pluginJar(MavenPublication) {  publication -&gt;
              from project.shadow.component(publication)
              artifact sourceJar
          }
      }
  }
  </code></pre>
  <p>When I run <code>publishToMavenLocal</code> task I can see that in result <code>pom.xml</code> contains a dependency that I do not want there.</p>
  <p>Let's say it's:</p>
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.example&lt;/groupId&gt;
    &lt;artifactId&gt;lib&lt;/artifactId&gt;
    &lt;version&gt;0.1.0&lt;/version&gt;
    &lt;scope&gt;runtime&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>How I can configure <code>publications</code> block in order to get rid of this dependency from the <code>pom.xml</code> (and module) file?</p>