title: How to iterate gradle dependencies in custom gradle plugin?
body: <p>I have followed this guide:</p>
  
  <p><a href="http://www.gradle.org/docs/current/userguide/custom_plugins.html" rel="noreferrer">http://www.gradle.org/docs/current/userguide/custom_plugins.html</a></p>
  
  <p>to create a standalone gradle plugin with the following structure/files:</p>
  
  <pre><code>  my-gradle-plugin
      &gt; src
       &gt; main
        &gt; java
         &gt; com
          &gt; mygroup
           &gt; MyGradlePlugin.groovy
      &gt; build.gradle
      &gt; settings.gradle
  </code></pre>
  
  <p><strong>build.gradle</strong> :</p>
  
  <pre><code>apply plugin: 'groovy'
  
  dependencies {
    compile gradleApi()
    groovy localGroovy()
  }
  
  apply plugin: 'maven'
  repositories {
    mavenCentral()
  }
  
  group = 'com.mygroup'
  version = '1.0.0-SNAPSHOT'
  </code></pre>
  
  <p><strong>MyGradlePlugin.groovy</strong> :</p>
  
  <pre><code>package com.mygroup
  
  import org.gradle.api.*
  
  class MyGradlePlugin implements Plugin&lt;Project&gt; {
  
    void apply(Project project) {
      print " project.name " + project.name + "\n"
      print " project.dependencies " + project.dependencies + "\n"
       // How do we iterate each dependency and print artifactId, group, version??
       // project.dependencies.each {
       //        compile(it) {
       //        print it.next()
       //        print it.name
       //      }
       //    }
     project.configurations.each {
    print it.dump()
  
  }
     }
    }
  </code></pre>
  
  <p>In another project I use/apply this plugin:</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'maven'
  apply plugin: 'eclipse'
  
  repositories {
    mavenLocal()
  }
  
  buildscript {
    repositories {
      mavenLocal()
    }
    dependencies {
      classpath group: 'com.mygroup', name: 'my-gradle-plugin', version: '1.0.0-SNAPSHOT'
    }
  }
  
  
  
  dependencies {
    compile group: 'commons-codec', name: 'commons-codec', version: '1.4'
    compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.7.0'
  }
  
  install.doLast {
   apply plugin: 'my-gradle-plugin'
  
  }
  </code></pre>
  
  <p>But how do I iterate the commons dependencies from the apply method in <strong>MyGradlePlugin.groovy</strong> and print their coordinates (artifactId, groupId, version)?</p>