下面是 fileset 元素的示例:
<fileset name="default">
<exclude pattern="(.*)\.err" />
<exclude pattern="(.*)\.log" />
<exclude pattern="(.*)\.lok" />
<exclude pattern="(.*)\.tlog" />
<exclude pattern="(.*)\.log0(.*)" />
</fileset>
<fileset name="NoCode">
<include-fileset name="default" />
<exclude pattern="(.*)\.jar" >
<include pattern="(.*)wily(.*)" />
</exclude>
<exclude pattern="(.*)\.zip" />
</fileset>
<fileset name="all">
<exclude pattern="(.*)>
<include pattern="(.*) />
</exclude>
</fileset>
文件集定义扫描中包括或排除的文件的模式。 fileset 元素允许的子元素有:
exclude 元素必须定义 pattern 属性。 exclude 元素可以包含 0 个或 0 个以上的 include 元素作为子节点。 include 元素必须定义 pattern 属性。 include 元素用于修正 exclude 元素。 在上面的示例中,对于文件集 NoCode,要排除所有以 .jar 结尾的文件名,但名称中包含 wily 的文件除外。
include-fileset 元素必须定义 name 属性。 使用 include-fileset 元素时,要包括的文件集必须已在之前定义好。 在上面的示例中,文件集 NoCode 包括文件集 default。 如果交换两个文件集的顺序,使 default 成为定义的第二个文件集,则配置将无效。 当文件集使用 include-fileset 元素时,所引用文件集的所有包括模式和排除模式均成为主元素的一部分。 在上面的示例中,文件集“NoCode”包含排除模式 *.jar、*.zip、*.err、*.log、*.lok 等。
fileset 元素中 exclude 和 include-fileset 元素的顺序无关紧要。 如果某文件不匹配定义的排除模式,将包括在扫描中。 如果某文件匹配定义的排除模式,则检查其是否匹配在该排除模式内定义的任何包括模式。 如果匹配一个包括模式,则将文件包括在扫描中。 如果不匹配任何包括模式,则从扫描中排除该文件。
|
版权所有 © 2013 CA。
保留所有权利。
|
|