posts - 262,  comments - 221,  trackbacks - 0

          【1】path和location屬性的區別:
           
          <classpath>
              <pathelement path="${classpath}"/>
               <pathelement location="lib/helper.jar"/>
          </classpath>
           
          原文:The location attribute specifies a single file or directory relative to the project's base directory (or an absolute filename), while the path attribute accepts colon- or semicolon-separated lists of locations. The path attribute is intended to be used with predefined paths - in any other case, multiple
          elements with location attributes should be preferred.
           
          從中我們可以看出path可以用于指向存在多個文件的位置,而location只能指向單個的文件或目錄。另外path可以被設定id,供其它的path或classpath引用。如:<path id="main-classpath">,而classpath則沒有

          【2】綜合示例:
          In addition, DirSets, FileSets, and FileLists can be specified via nested <dirset>, <fileset>, and <filelist> elements, respectively. Note: The order in which the files building up a FileSet are added to the path-like structure is not defined.
           
              <classpath>
                <pathelement path="${classpath}"/方式① :引用特定的變量

                <fileset dir="lib"方式② :指向特定的文件集
                  <include name="**/*.jar"/>
                </fileset>

                <pathelement location="classes"/方式③:指向單個目錄

                <dirset dir="${build.dir}"方式④:指向特定目錄集
                  <include name="apps/**/classes"/>
                  <exclude name="apps/**/*Test*"/>
                </dirset>

                <filelist refid="third-party_jars"/> 方式⑤:引用指定文件列表
              </classpath>
           
          This builds a path that holds the value of ${classpath}, followed by all jar files in the lib directory, the classes directory, all directories named classes under the apps subdirectory of ${build.dir}, except those that have the text Test in their name, and the files specified in the referenced FileList.



          -------------------------------------------------------------
          生活就像打牌,不是要抓一手好牌,而是要盡力打好一手爛牌。
          posted on 2008-04-21 14:28 Paul Lin 閱讀(1936) 評論(0)  編輯  收藏 所屬分類: Java 工具
          <2008年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點博客

          好友博客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 屏东市| 正阳县| 隆回县| 富锦市| 东乡| 三门峡市| 宜君县| 沧州市| 双鸭山市| 方山县| 盈江县| 濉溪县| 改则县| 广灵县| 教育| 崇仁县| 尼木县| 苗栗市| 姜堰市| 长垣县| 西昌市| 都匀市| 宁南县| 定陶县| 闸北区| 潼关县| 石泉县| 东平县| 巴彦淖尔市| 浏阳市| 当涂县| 蒙城县| 富裕县| 玉树县| 延安市| 高雄县| 广平县| 济南市| 蒙阴县| 玉树县| 镇远县|