title: Groovy Maven Compilation fails with error: Unable to determine Groovy version. Is Groovy declared as a dependency?
body: <p>I have a fairly vanilla groovy project that builds using maven. It utilises the gmavenplus plugin, with the pom lifted straight from <a href="https://github.com/groovy/GMavenPlus/wiki/Examples" rel="nofollow noreferrer">the gmaven plus web page</a></p>
  
  <p>pom looks something like this:</p>
  
  <pre><code>&lt;project&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.gmavenplus&lt;/groupId&gt;
          &lt;artifactId&gt;gmavenplus-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.8.0&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;addSources&lt;/goal&gt;
                &lt;goal&gt;addTestSources&lt;/goal&gt;
                &lt;goal&gt;compile&lt;/goal&gt;
                &lt;goal&gt;compileTests&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&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;!-- any version of Groovy \&gt;= 1.5.0 should work here --&gt;
        &lt;version&gt;2.5.8&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>When I build, I get the following error on the compile stage.</p>
  
  <pre><code>[INFO] --- gmavenplus-plugin:1.8:compile (default) @ myapp---
  [INFO] Unable to get Groovy version from GroovySystem, trying InvokerHelper.
  [WARNING] Unable to get Groovy version from InvokerHelper or GroovySystem, trying jar name.
  [ERROR] Unable to determine Groovy version. Is Groovy declared as a dependency?
  </code></pre>
  
  <p>And the final maven error results in this:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.8:compile (default) on project myapp: Execution default of goal org.codehaus.gmavenplus:gmavenplus-plugin:1.8:compile failed. NullPointerException -&gt; [Help 1]
  </code></pre>
  
  <p>I have tried all manner of tricks, hacks and cajoling to get it to compile. I actually got it working in Intellij by adding the groovy runtime as a direct module dependency (rather than a maven managed dependency), but this doesn't work from the command line. </p>
  
  <p>I had previously had a similar setup working on gmaven plus 1.6 and groovy 2.4.7 on the same laptop, no idea why this is broken now. </p>