title: How to add dependency to configuration in gradle plugin
body: <p>I'm developing Gradle custom plugin. I want to add dependency to the existing configuration. I'm trying to do it like this:</p>
  
  <pre><code>open class MyApplicationExtension @Inject constructor(objects: ObjectFactory) {
    val version: Property&lt;String&gt; = objects.property(String::class)
  }
  
  class MyApplicationPlugin : Plugin&lt;Project&gt; {
    override fun apply(project: Project) {
      project.plugins.apply(ApplicationPlugin::class)
      val extension = project.extensions.create&lt;MyApplicationExtension&gt;("myApp")
      val implConfig = project.configurations["implementation"]
      implConfig.defaultDependencies {
        add(project.dependencies.create("com:my-app:${extension.version.get()}"))
      }
    }
  }
  </code></pre>
  
  <p>But when I try to use application in gradle project the added dependency is not added. I'm trying to use it like this:</p>
  
  <pre><code>apply&lt;MyApplicationPlugin&gt;()
  the&lt;MyApplicationExtension&gt;().version.set("0.1.0")
  
  dependencies {
    // This overrides the default dependencies
    implementation("com:another:0.2.0")
  }
  </code></pre>
  
  <p>And when I invoke <code>dependencies</code> task my dependency is not shown there. So how to add configurable dependency to the <code>implementation</code> configuration from custom plugin? Running with Gradle 5.3.1 in Kotlin DSL.</p>