title: Building war with Gradle, Debugging with IntelliJ IDEA
body: <p>I have JavaEE webapp project(named ProjectA) developed in IntelliJ IDEA.It has <em>build.gradle</em> file that applies war plugin :</p>
  
  <pre><code>apply plugin: 'war'
  </code></pre>
  
  <p>I want to debug(or run) <strong>gradle generated war file</strong> instead of debugging <strong>auto generated intellij artifact</strong>.
  It's very important for me that I can update classes changed during debugging without need to restart server.</p>
  
  <p><img src="https://i.stack.imgur.com/wh6tj.png" alt="enter image description here"></p>
  
  <p>How can I do it?</p>
  
  <p>Note that :</p>
  
  <p>1) When click refresh button in gradle plugin tab (<img src="https://i.stack.imgur.com/Q5Kbd.png" alt="refresh all Gradle peojects">) Intellij updates all project configurations(for example module dependencies) and generate artifacts.I called it <strong>auto generated intellij artifact</strong>.
  <img src="https://i.stack.imgur.com/gOBWX.png" alt="enter image description here"></p>
  
  <p>For run it,I should only create new local Tomcat Server configuration and add artifact to deployment tab.
  <img src="https://i.stack.imgur.com/h1TD9.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/HGEXP.png" alt="enter image description here"></p>
  
  <p>2) In addition,there is some gradle tasks(clean,build,war and etc).I can execute <em>build task</em> or <em>war task</em> to generate war file.I called it <strong>gradle generated war file</strong>. </p>