如何在使用maven编译时忽略.java文件? [英] How to ignore .java files when compiling using maven?

查看:2432
本文介绍了如何在使用maven编译时忽略.java文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的源目录中的.java文件,由于一些API更改不能编译。

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.

推荐答案

有了maven编译器插件和排除选项:

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>

资源:

  • Maven 2 Compiler plugin - Compile mojo

这篇关于如何在使用maven编译时忽略.java文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆