title: Groovy application classes and Java Unit tests
body: <p>I've got an application being build by Maven that is a mixed Groovy and Java project.  </p>
  
  <p>Using the GMaven plugin(v1.3), I can easily run Groovy tests against Java and Groovy classes.  And during builds of the application, my java classes get linked against the augmented stub files that declare methods from GroovyObject.</p>
  
  <p>However, if I write a test in Java against the application Groovy code and try to call methods from GroovyObject, I get compile time failures.</p>
  
  <p>Is there any workaround for this?  Is there any configuration parameters to GMaven that will make this possible?</p>
  
  <p>thanks.</p>
  
  <p>here's the build.plugins stuff from my pom:</p>
  
  <pre><code>             &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;includes&gt;
                              &lt;include&gt;target/generated-sources/groovy-stubs/main&lt;/include&gt;
                          &lt;/includes&gt;
                      &lt;/configuration&gt;
                  &lt;/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.3&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;generateStubs&lt;/goal&gt;
                                  &lt;goal&gt;generateTestStubs&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;configuration&gt;
                                  &lt;!-- providerSelection probably defaults to 1.7 now --&gt;
                                  &lt;providerSelection&gt;1.7&lt;/providerSelection&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
  </code></pre>
  
  <p>Here's the java test class:</p>
  
  <pre><code>public class JavaGroovyTest extends TestCase {
        @Test
        public void testGroovyClasses(){
          Model m = new Model();  //Model is an application class written in Groovy
          assertNotNull(m);
          assertEquals(4,m.getMetaClass().getProperties().size());
        }
  }
  </code></pre>
  
  <p>And here's the compiler output:</p>
  
  <pre><code>[ERROR] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Compilation failure
  /Users/mkohout/Documents/trunk/src/test/java/JavaGroovyTest.java:[17,24] cannot find symbol
  symbol  : method getMetaClass()
  location: class com.q.Model
  </code></pre>