如何排除在Ant中使用javac源码包? [英] How to exclude a source package using javac in Ant?

查看:249
本文介绍了如何排除在Ant中使用javac源码包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看着一堆不同的例子,并尝试一些变化,但似乎无法得到这个工作正常。这似乎也可以不排除用javac整个目录,但只有文件,这一点我想意味着你不能指定一个包?以下是我有:

 < javac的SRCDIR =SRCDESTDIR =WEB-INF / classes中排除=路径/要/排除/包/ * java的>
    <类路径REFID =compile.classpath/> &所述;! - 参考前面定义 - >
< / javac的>


解决方案

您可以排除整个目录或目录树有**并排除。示例

 < dirset DIR =a目录>
    <包括姓名=A /包/ **/>
    <排除NAME =** /包/到/排除**/>
< / dirset>

I've looked at a bunch of different examples, and tried several variations, but can't seem to get this working correctly. It also appears that you can't exclude an entire directory with javac, but only files, which I suppose means you can't specify a package? Here is what I have:

<javac srcdir="src" destdir="WEB-INF/classes" excludes="path/to/excluded/package/*.java">
    <classpath refid="compile.classpath"/> <!-- reference defined earlier -->
</javac>

解决方案

You can exclude whole directories or directory trees with "**" and exclude. Example

<dirset dir="aDirectory">
    <include name="a/package/**"/>
    <exclude name="**/package/to/exclude**"/>
</dirset>

这篇关于如何排除在Ant中使用javac源码包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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