How to ignore .java files when compiling using maven?

偶尔善良 提交于 2019-12-22 08:13:35

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/3621727/how-to-ignore-java-files-when-compiling-using-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!