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

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點博客

          好友博客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 洞口县| 大邑县| 洛阳市| 格尔木市| 汪清县| 平南县| 锡林浩特市| 连城县| 南开区| 余姚市| 岑巩县| 通道| 铁岭县| 岢岚县| 嘉祥县| 麟游县| 岑巩县| 元阳县| 荃湾区| 财经| 子洲县| 日喀则市| 永胜县| 古丈县| 天峨县| 济南市| 安徽省| 锡林郭勒盟| 静乐县| 巴东县| 密山市| 札达县| 文登市| 宜兰市| 陆丰市| 永善县| 乐清市| 孝昌县| 礼泉县| 精河县| 繁峙县|