原因是像CVS这样的一些特殊目录或文件被ant默认进行忽略。

看下边这个类,所有忽略的目录及文件都在这里列出来了。

org.apache.tools.ant.DirectoryScanner

    protected static final String[] DEFAULTEXCLUDES = {
        // Miscellaneous typical temporary files
        "**/*~",
        "**/#*#",
        "**/.#*",
        "**/%*%",
        "**/._*",

        // CVS
        "**/CVS",
        "**/CVS/**",
        "**/.cvsignore",

        // SCCS
        "**/SCCS",
        "**/SCCS/**",

        // Visual SourceSafe
        "**/vssver.scc",

        // Subversion
        "**/.svn",
        "**/.svn/**",

        // Mac
        "**/.DS_Store"
    };

 

我们可通过在build.xml中引入defaultexcludes 标记从默认忽略中去除我们用到的目录或
 <defaultexcludes remove="**/CVS"/>
 <defaultexcludes remove="**/CVS/**"/>
 <defaultexcludes remove="**/.cvsignore"/>

 关于defaultexcludes 标记的详细说明如下:

since Ant 1.6

*Description*

Alters the default excludes for all subsequent processing in the build, and prints out the current default excludes if desired.

*Parameters*

Attribute Description Required
echo whether or not to print out the default excludes.(defaults to false) attribute "true" required if no other attribute specified
default go back to hard wired default excludes attribute "true" required if no if no other attribute is specified
add the pattern to add to the default excludes if no other attribute is specified
remove remove the specified pattern from the default excludes if no other attribute is specified

*Examples*

Print out the default excludes

  <defaultexcludes echo="true"/>

Print out the default excludes and exclude all *.bak files in all further processing

  <defaultexcludes echo="true" add="**/*.bak"/>

Silently allow several fileset based tasks to operate on emacs backup files and then restore normal behavior

  <defaultexcludes remove="**/*~"/>

  (do several fileset based tasks here)

  <defaultexcludes default="true"/>

这次没有点加入到论坛,我看看到底怎么回事。

评论
发表评论

您还没有登录,请登录后发表评论

letle
搜索本博客
存档
最新评论