title: Gradle embedded jetty plugin is not stopping automatically
body: <p>I am able to run embedded jetty with gradle jettyRunWar command. However, it is not automatically stopped on program termination.</p>
  
  <p>I tried below two code after searching the solution on stackoverflow and other forums. But none works.</p>
  
  <p>1) build.gradle</p>
  
  <pre><code>apply plugin: 'jetty'
  
  task runJetty() {
  
      jettyStop.stopPort = 8090
  
      dependsOn jettyRunWar
      finalizedBy jettyStop
  }
  </code></pre>
  
  <p>2) build.gradle</p>
  
  <pre><code>apply plugin: 'jetty'
  
  task runJetty() {
  
      doFirst {
          jettyRunWar.stopPort = 8090
          jettyRunWar.stopKey = 'stopKey'
  
          jettyRunWar.daemon = true
          tasks.jettyRunWar.execute()
      }
  
      doLast {
          jettyStop.stopPort = 8090
          jettyStop.stopKey = 'stopKey'
  
          tasks.jettyStop.execute()
      }
  }
  </code></pre>
  
  <p>In both cases, on running runJetty task, embedded jetty server starts but did not stop on program termination.</p>
  
  <p>FWIW: I am using Eclipse External Tools Configuration to start and terminate build.gradle. And, using 8080 port in the url to test.</p>