posts - 262,  comments - 221,  trackbacks - 0

          【1】path和location屬性的區(qū)別:
           
          <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可以用于指向存在多個(gè)文件的位置,而location只能指向單個(gè)的文件或目錄。另外path可以被設(shè)定id,供其它的path或classpath引用。如:<path id="main-classpath">,而classpath則沒(méi)有

          【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"/方式③:指向單個(gè)目錄

                <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 閱讀(1929) 評(píng)論(0)  編輯  收藏 所屬分類: Java 工具
          <2008年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點(diǎn)博客

          好友博客

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 公主岭市| 哈尔滨市| 大化| 长春市| 长子县| 东光县| 岑溪市| 阳山县| 左贡县| 衡阳县| 剑川县| 元氏县| 沈阳市| 咸宁市| 汉寿县| 云龙县| 饶平县| 荆州市| 海淀区| 三河市| 南涧| 八宿县| 镇远县| 盐边县| 岳阳县| 孟连| 长宁县| 盘山县| 太谷县| 华宁县| 中牟县| 江华| 昭平县| 平泉县| 郴州市| 同仁县| 长治市| 黑河市| 金阳县| 沙湾县| 盘山县|