title: Intellij IDEA gradle debug plugin
body: <p>Using IDEA 2017.1(ue); I like to know how I can debug a gradle plugin. I've setup a very simple gradle project (<a href="https://github.com/tkvw/gradle-plugin-debug" rel="nofollow noreferrer">https://github.com/tkvw/gradle-plugin-debug</a>). The project references one plugin org.gradle.hello-world.</p>
  
  <p>My questions are:</p>
  
  <p>1) Where can I set a breakpoint on the helloworld plugin? Normally I lookup my classes/sources using search anywhere in IDEA, but it doesn't find the class/sources. Idea seems to ignore the buildscript dependencies of the gradle build in it's sources lookup path?. (I tried the "old" buildscript block + apply as well)</p>
  
  <p>2) How do I setup -Dorg.gradle.debug=true on the run configuration? If I specify it like this: the task simply runs and doesn't wait for a debugger to be attached. 
  <a href="https://i.stack.imgur.com/7nlQV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7nlQV.png" alt="Run configuration"></a>
  From the command prompt the command </p>
  
  <pre><code>gradlew -Dorg.gradle.debug=true helloworld 
  </code></pre>
  
  <p>does run and wait for a debugger to connect.  </p>