maven-compiler-plugin exclude

后端 未结 1 1083
死守一世寂寞
死守一世寂寞 2021-01-01 16:44

I have a following problem. I would like to exclude some .java files (**/jsfunit/*.java) during the test-compile phase and on the other side I would like to include them dur

相关标签:
1条回答
  • 2021-01-01 17:20

    To exclude files from the default-testCompile phase, you have to use <testExcludes>. So your example above would look like so:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>1.6</source>
        <target>1.6</target>
      </configuration>
      <executions>
        <execution>
          <id>default-testCompile</id>
          <phase>test-compile</phase>
          <configuration>
            <testExcludes>
              <exclude>**/jsfunit/*.java</exclude>
            </testExcludes>
          </configuration> 
          <goals>
            <goal>testCompile</goal>
          </goals>
        </execution>                  
      </executions>
    </plugin>
    
    0 讨论(0)
提交回复
热议问题