title: Grunt, Livereload with maven and jetty server
body: <p>I am wondering if its at all possible to use grunt and livereload with my current java web application that is using maven and jetty?</p>
  
  <p>The way my current java web application works is that I run maven to build the webapp and it also creates a local jetty server with my java application running on it. I'd like to be able to have livereload using the jetty server, rather than having grunt create a new localhost server where it's looking for a index.html page to load.</p>
  
  <p>Gruntfile.js (just a couple snippets from my gruntfile.js)</p>
  
  <pre><code>var LIVERELOAD_PORT = 35729;
  var lrSnippet = require('connect-livereload')({
    port: LIVERELOAD_PORT
  });
  var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
  };
  
      connect: {
        options: {
          port: 9000,
          hostname: '*'
        },
        livereload: {
          options: {
            middleware: function (connect) {
  
              return [lrSnippet, mountFolder(connect, 'src/main/webapp/')];
            }
          }
        }
      },
      open: {
        server: {
          path: 'http://localhost:&lt;%= connect.options.port %&gt;'
        }
      }
  </code></pre>