title: How to use gradle run with Intellij IDEA?
body: <p>I have the following <code>build.gradle</code> file:</p>
  
  <pre><code>apply plugin:'application'
  
  mainClassName = "MyMain"
  
  allprojects {
      sourceCompatibility = 1.7
      targetCompatibility = 1.7
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile 'org.jsoup:jsoup:1.8.3'
  }
  </code></pre>
  
  <p>So when I do <code>gradle run</code> it works perfectly, it uses jsoup and so.</p>
  
  <p>Now, I've imported this project at my Intellij Idea IDE, I created a gradle build run/debug configuration, so when I press the green arrow 'run', it's building the application, but not running it, so I guess it's executing <code>gradle build</code>. </p>
  
  <p>I've searched for an way to run the application, and the Intellij Idea says that I must create a new Application run/debug configuration. I did it, told where my main class was, but when I click run, it tries to make the source code, and claims that it can't find Jsoup for compiling. </p>
  
  <p>How can I mimic <code>gradle run</code> in intellij idea's IDE? </p>