title: Gradle remove specific dependency configuration from generated pom
body: <p>I need to ignore some dependencies defined in the configuration "configurations.nonDistributable" when using gradles plugin maven-publish to generate pom files, I haven't found a reliable way of doing this, except for manually parsing the XML to remove them. Am I missing something, does gradle allow for an easier way of doing this?</p>
  
  <p>build.gradle example:</p>
  
  <pre><code>configurations{
      nonDistributable
  }
  
  dependencies {
      nonDistributable ('org.seleniumhq.selenium:selenium-java:2.52.0'){
          exclude group:'com.google.guava' // included in elasticsearch
      }
  
      nonDistributable ('com.assertthat:selenium-shutterbug:0.3') {
          transitive = false
      }
  
      nonDistributable 'mysql:mysql-connector-java:5.1.40'
      nonDistributable fileTree(dir: 'non-distributable-libs', include: '*.jar')
  }
  
  // generate subprojects pom
  subprojects {
      apply plugin: 'maven-publish'
      model {
          tasks.generatePomFileForMavenJavaPublication {
              destination = file("$buildDir/../../$distDir/build/pom/$project.name-pom.xml")
          }
      }
      afterEvaluate { project -&gt;
          publishing {
              publications {
                  mavenJava(MavenPublication) {
                      from components.java
                  }
              }
          }
      }
  }
  
  // generate root project pom
  model {
      tasks.generatePomFileForMavenJavaPublication {
          destination = file("$buildDir/../$distDir/build/pom/$project.name-pom.xml")
      }
  }
  afterEvaluate { project -&gt;
      publishing {
          publications {
              mavenJava(MavenPublication) {
                  from components.java
              }
          }
      }
  }
  </code></pre>