Getting Groovy-Eclipse, gmaven, and Eclipse all working together seems to be pretty tricky at the present. Once you've got a project created with mvn archetype:generate
, as AWhitford mentions, this site will show you a few of the tweaks you'll need to make it work.
GMaven's stub creation for Java files interferes with Groovy-Eclipse, hence the section on that page about commenting out stub creation. However, I went with the method mentioned in the comments for the relevant bug (GMAVEN-61) and created multiple executions for the gmaven plugin, like so:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.0-rc-3</version>
<!-- http://jira.codehaus.org/browse/GMAVEN-61 -->
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
<execution>
<id>stubsonly</id>
<goals>
<goal>generateStubs</goal>
<goal>generateTestStubs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
I'm still not certain myself that this is clean for both pure Maven usage as well as within Eclipse, but it at least got me to the point where I stopped spending hours trying to get anything to work and got me coding on my actual project.
The Groovy-Eclipse and GMaven documentation are good reading for background info.