title: how to use the groovy maven plugin
body: <p>I want to auto compile and run test when I use <code>mvn test</code> or <code>mvn install</code></p>
  
  <p>I used to use <code>gmaven-plugin</code> and it works will.</p>
  
  <p>But when I use the <code>groovy-maven-plugin</code>,the new version of gmaven, it doesn't work!</p>
  
  <p>So how to config?</p>
  
  <p>Here is my <code>pom.xml</code>:</p>
  
  <pre><code>&lt;!-- gmaven-plugin --&gt;
  &lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.gmaven&lt;/groupId&gt;
      &lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.5&lt;/version&gt;
      &lt;configuration&gt;
          &lt;providerSelection&gt;2.0&lt;/providerSelection&gt;
          &lt;source/&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;goals&gt;
                  &lt;goal&gt;generateStubs&lt;/goal&gt;
                  &lt;goal&gt;compile&lt;/goal&gt;
                  &lt;goal&gt;generateTestStubs&lt;/goal&gt;
                  &lt;goal&gt;testCompile&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.gmaven.runtime&lt;/groupId&gt;
              &lt;artifactId&gt;gmaven-runtime-2.0&lt;/artifactId&gt;
              &lt;version&gt;1.5&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                      &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
              &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
              &lt;version&gt;${groovy.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/plugin&gt;
  
  &lt;!-- groovy-maven-plugin --&gt;
  &lt;plugin&gt;
    &lt;groupId&gt;org.codehaus.gmaven&lt;/groupId&gt;
    &lt;artifactId&gt;groovy-maven-plugin&lt;/artifactId&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
        &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
        &lt;version&gt;${groovy.version}&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/plugin&gt;
  </code></pre>