3

我目前正在使用 groovy-eclipse-compiler,我正在尝试在我的src/main/groovy目录下包含和排除某些目录;默认情况下(没有过滤器)编译器包含所有内容,但是当我排除源路径中的所有 groovy 文件时,过滤器会起作用。

排除所有过滤器作品:WORKS 构建输出目录

            <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>

Include 和 Excludes 的组合:DOES NOT WORK 构建输出目录

            <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>

相关的.classpath文件数据

Pom.xml 插件部分

4

0 回答 0