首先是goovy依赖
<!--groovy -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.8</version>
</dependency>
关键的 maven-compiler-plugin的配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
<!-- Bind Groovy Eclipse Compiler -->
<!-- 注掉下面这一行的话,就会导致编译器无视goovy文件哦-->
<compilerId>groovy-eclipse-compiler</compilerId>