Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore .java files when compiling using maven?

I have .java files in my source directory that don't compile yet due to some API change. I would like to fix sources one by one and it would be useful to ignore some of them to run tests.

like image 705
Alexandru Avatar asked Dec 22 '22 23:12

Alexandru


1 Answers

With the maven compiler plugin and the exclude option:

  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <excludes>
                    <exclude>**/*Point*.java</exclude>
                </excludes>
            </configuration>
         </plugin>
     </plugins>
  </build>

Resources:

  • Maven 2 Compiler plugin - Compile mojo
like image 84
Colin Hebert Avatar answered Dec 27 '22 11:12

Colin Hebert