我目前正在使用groovy-eclipse-compiler,我试图在 src / main / groovy 目录下包含并排除某些目录;默认情况下(没有过滤器)编译器包含所有内容,但是当我排除源路径中的所有groovy文件时,过滤器可以正常工作。
排除所有过滤器的工作原理:工作 Build output directory
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<!-- <compilerArgument>${COMPILERARGS}</compilerArgument> <executable>${JAVA_HOME}/bin/javac</executable> -->
<showDeprecation>true</showDeprecation>
<encoding>UTF8</encoding>
<compilerId>groovy-eclipse-compiler</compilerId>
<excludes>
<exclude>**/*.groovy</exclude>
</excludes>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.8.0-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.1.5-03</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
包含和排除的组合:不起作用 Build output directory
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<!-- <compilerArgument>${COMPILERARGS}</compilerArgument> <executable>${JAVA_HOME}/bin/javac</executable> -->
<showDeprecation>true</showDeprecation>
<encoding>UTF8</encoding>
<compilerId>groovy-eclipse-compiler</compilerId>
<excludes>
<exclude>src/main/groovy/controller/**/*.groovy</exclude>
<exclude>src/main/groovy/transformer/listing/**/*.groovy</exclude>
</excludes>
<includes>
<include>src/main/groovy/transformer/utils/**/*.groovy</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.8.0-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.1.5-03</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>