`
雨过天晴0521
  • 浏览: 154898 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ant的excludes属性

 
阅读更多
zipfileset和fileset标签的属性完全兼容, 其中excludes属性应用例子如下:

    <target name="distribution.package">
        <zip destfile="../test2.zip" >
            <zipfileset dir="D:\tmp\components" prefix="components" excludes="**/com.tibco.security.tibcrypt_2.14.300.006.jar, **/jmssr.httpbasic_3.2.0/**, **/policyplatform.httpbasic_3.2.0/**"/>
            <zipfileset dir="D:\tmp" includes="jspwiki.log"/>
    </zip>
    </target>


D:\tmp文件夹下的目录结构如下图



打包的时候想要排除com.tibco.security.tibcrypt_2.14.300.006.jar文件, jmssr.httpbasic_3.2.0文件夹和policyplatform.httpbasic_3.2.0文件夹, 这两个文件夹分别在components/shared/1.0.0的plugins和features文件夹下.

excludes的使用需要注意两点:

1. excludes里的值不能是文件或文件夹的绝对路径
2. 打包目录下, 不能使用两次excludes, 否则两个exclude都无效, 如果是同一目录, 完全可以放在同一行里, 用逗号或空格隔开即可

            <zipfileset dir="D:\tmp\components" prefix="components" excludes="**/plugins/**/*.jar"/>
            <zipfileset dir="D:\tmp\components" prefix="components" excludes="**/jmssr.httpbasic_3.2.0/**"/>


3. 如果想排除某个目录下的文件夹只需在excludes属性值里这样写**/[文件夹名称]/**即可, 文件的写法是**/[文件名称], 注意如果想过滤文件时, **/[文件名称]/**这样写也是没有问题的, 有的人可能会问, 这些写的意义是什么,请参考http://michael0521.iteye.com/blog/1541529 中的应用场景2中的用法. 还有其他的格式如**/*Test*, 代表所有含Test字符串的文件



http://stackoverflow.com/questions/945374/how-to-pull-out-a-substring-in-ant
分享到:
评论

相关推荐

    替换文本文件中Ant表达式的Ant扩展任务

    该程序为Ant的扩展任务,在拷贝文本格式的文件的同时替换文件中的Ant表达式,类似于 ${property.name},属性值来自于Ant脚本加载的属性文件,如果没有属性文件中没有定义相关属性,那么保留原来的表达式;...

    cas-client扩展拦截器支持excludes

    cas-client扩展拦截器支持excludes,用于支持排除拦截指定路径。只是简单的在filter中进行过滤,希望大家继续完善。

    Maven权威指南 很精典的学习教程,比ANT更好用

    Fine Tuning: Dependency Includes and Excludes 12.5.4.5. Transitive Dependencies, Project Attachments, and Project Artifacts 12.5.4.6. Advanced Unpacking Options 12.5.4.7. Summarizing Dependency ...

    rsync-homedir-excludes

    rsync-homedir-排除该项目维护您可能不需要备份的目录和文件的列表,您可以将其传递给rsync命令的--exclude-from选项。用法: # download to `rsync-homedir-local.txt`wget ...

    serverless-plugin-common-excludes:从无服务器包中排除常见问题

    无服务器插件常见排除注意:此插件不再排除与AWS最佳实践...安装安装插件:npm install serverless-plugin-common-excludes --save-dev 将插件包含在serverless.yml : plugins : - serverless-plugin-common-excludes

    arr-exclude:从数组中排除某些项目

    排除从数组中排除某些项目安装 $ npm install --save arr-exclude用法 const arrExclude = require ( 'arr-exclude' ) ;arrExclude ( [ 'a' , 'b' , 'c' ] , [ 'b' ] ) ;//=&gt; ['a', 'c']有关的在数组中仅包含某些项...

    css-exclude:排除在多个文件中找到的 CSS 规则

    #什么是css-exclude ? css-exclude 是一个简单的实用程序,它允许您输入两个 css 文件,并让该实用程序打印出在第一个文件中找到的规则/at-rules,而不是在第二个文件中。 css-exclude 不关心文档顺序,这使得在...

    exclude:函数将数字排除在用“全部关闭”关闭之外。-matlab开发

    函数首先将 closerequestfcn 存储到 appdata 中,然后将其设置为空白。... 这允许用户在生成其他图形的同时保留图形,并使用 close all 快速摆脱不再感兴趣的图形。 要重置 closerequestfcn 使用 include(对于具有...

    javaee6源码-android-build-filter-gradle-plugin:一个小众需求下移除Android构建中Jar包、AA

    java ee 6 源码 android-build-filter-gradle-plugin 一个小众需求下移除 Android 构建中 Jar 包、AAR 包、构建冗余 class 文件的 Gradle 插件。 配置 在相应 gradle 文件添加如下仓库。 buildscript ...]

    searchq:Emacs-将搜索任务排入队列,在后台运行它们并将结果记为简笔

    排队搜索任务,在后台运行它们以及更多 一个搜索框架,可让您在后台搜索字符串或正则表达式并使搜索任务排队。... 列表的第二个元素是EXCLUDES字符串列表。 包括和排除的格式取决于searchq-backends (后端应说明其文档

    excludify:忽略 browserify 模块中的 require 调用

    安装npm install --save-dev excludify例子包.json: { "excludify" : { "excludes" : [ "*.css" , "*.less" ] }} 壳: browserify index.js -t [ excludify --excludes " *.css " ] &gt; bundle.js 浏览器 API: var b...

    MFC ModifyStyle

    WS_CLIPCHILDREN Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window. WS_CLIPSIBLINGS Clips child windows relative to each other;...

    UnityScriptEditor 2.7

    UnityScript features Intelliprompt support for all of UnityScripts functions and commands (excludes Editor specific functions), as well as command details when the mouse is hovered over keywords....

    LeakIXClient:Golang客户端和库

    -j JSON mode, (excludes -t) -l int Limit results output (default 100) -q string Search mode, specify search query (default " * " ) -r Realtime mode, (excludes -q) -s string Specify scope ...

    人工智能-项目实践-指纹识别-通用的指纹识别规则

    "excludes": "Apache" } 描述: FIELD TYPE DESCRIPTION EXAMPLE REQUIRED name string 组件名称 wordpress true author string 作者名 fate0 false version string 插件版本 0.1.0 false description string 组件...

    sitemesh使用例子

    sitemesh 使用例子。... &lt;excludes&gt; &lt;/excludes&gt; &lt;!-- 用来定义装饰器要过滤的页面 --&gt; &lt;decorator name="index" page="index.jsp"&gt; &lt;pattern&gt;/*&lt;/pattern&gt; &lt;/decorator&gt; &lt;/decorators&gt;

    PlayServicesStrip-plugin:已弃用 - 请改用 play-services 6.x。 Gradle 插件来剥离你的谷歌播放服务

    将插件添加到您的类路径,应用插件(在 android gradle 插件之后)并添加includes或excludes dependencies { classpath ' com.github.castorflex.playservicesstrip:plugin:1.0.2 ' } apply plugin : ' ...

    mkdocs-htmlproofer-plugin

    mkdocs-htmlproofer-plugin 一个插件,... plugins : - search - htmlproofer : raise_error : True 通过将某些URL或状态代码添加到raise_error_excludes列表中,可以将其raise_error_excludes 。 plugins : - search

    daemontools-0.76

    It optionally timestamps each line and, for each log, includes or excludes lines matching specified patterns. It automatically rotates logs to limit the amount of disk space used. If the disk fills up...

    fscrawler:Elasticsearch文件系统搜寻器(FS搜寻器)

    Elasticsearch的文件系统爬网程序 欢迎使用的FS 该搜寻器有助于索引二进制文档,例如PDF,Open Office,MS Office。 主要特点: 本地文件系统(或已安装的驱动器)对新文件进行爬网和建立索引,更新现有文件并删除...

Global site tag (gtag.js) - Google Analytics