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

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

问题描述

我查看了许多不同的示例,并尝试了几种变体,但似乎无法正常工作.似乎您无法使用 javac 排除整个目录,而只能排除文件,我想这意味着您无法指定包?这是我所拥有的:

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天全站免登陆