ant學習筆記 taskdef

2021-06-25 07:15:19 字數 619 閱讀 1772

1、宣告task jar包中指定的task

classname="com.oopsconsultancy.xmltask.ant.xmltask"

classpath="./xmltask.jar" />

然後,就可以使用當前目錄下,xmltask.jar包中,提供的com.oopsconsultancy.xmltask.ant.xmltask任務了,任務標籤為xmltask

2、載入指定task jar中的properties檔案

或者classpath="./ant-contrib-1.0b3.jar" />

然後,就可以使用當前目錄下,ant-contrib-1.0b3.jar包中,net/sf/antcontrib/antcontrib.properties檔案中,提供的所有宣告task了

3、載入自定義properties檔案

在自定義task.properties檔案中:

document=xdoclet.doc.documentdoclettask

xdoclet=xdoclet.doclettask

....

在ant檔案中,

classpath="./xmltask.jar" />

參考:

ant學習筆記

這樣我們在dos當前目錄下輸入這樣ant命令就完成了拷貝檔案的工作 五.如何編寫buildfile 1.project.每個buildfile含有乙個project 2.project有下面的屬性 name 專案名稱.default 當沒有指定target時使用的預設target yes based...

ant 學習筆記11

我的專案目錄結構 test src webroot build.xml build.xml檔案 執行build.xml的方法 ant使用當前目錄下的build.xml執行ant,執行預設的target。ant buildfile test.xml 使用當前目錄下的test.xml執行ant,執行預設...

學習筆記 Eclispe執行ant

eclipse 內建的 ant 支援可讓外掛程式依程式的方式執行 ant 建置檔。透過併入在.eclipse.ant.core外掛程式中的 antrunner 類別來完成 import eclipse.ant.core.antrunner import eclipse.core.runtime.ip...