推薦使用 :(來自官方文件)
使用 restrict archives
destfile=
"$/$-$.jar"
basedir=
"$">
name=
"**/*.class"
/>
refid=
"log4j-1.2.15.jar"
/>
refid=
"commons-codec-1.4.jar"
/>
dir=
"$/lib"
includes=
"*.jar"
/>
dir=
"$"includes=
/>
name=
"main-class"
value=
"com.yoyosys.woyun.comparefilemd5orlength"
/>
這裡可以新增 制定的jar 包,但是,制定的jar包 不會在 classpath中使用,所喲要使用
manifest 的 class-path 屬性 ,將 jar包的內 打進的jar包 ,路徑指定了 ,
1 manifest-version: 1.0
2 ant-version: apache ant 1.8.2
3 created-by: 1.6.0_31-b04 (sun microsystems inc.)
4 main-class: com.yoyosys.woyun.comparefilemd5orlength
5 class-path: log4j-1.2.15.jar commons-codec-1.4.jar
將打好的jar包 解壓 可以看到 在 :meta-inf/manifest.mf 資訊中可以看到 表明 在 打好的jar保重 包含 了
log4j-1.2.15.jar commons-codec-1.4.jar 這兩個jar 包
將多個jar合併成乙個jar的問題
1 將所有jar檔案複製至某臨時目錄中,通過jar命令解壓得到所有的.class檔案 jar xvf xx.jar xx.jar必須為具體的jar,不能為 jar,會報filenotfoundexception 2 刪除臨時目錄下所有的jar檔案 del f jar 3 合併所有.class檔案至j...
ant打包war到jboss的乙個錯誤
xml warwarfile war webtest.war basedir webxml web inf web.xml include name include name web inf exclude name web inf web.xml exclude name web inf clas...
將乙個dataTable拆成多個
最近遇到乙個問題害我鬱悶了很久,在乙個頁面裡分類顯示資料,每乙個大類裡的資料是動態取得。打算將它分三列顯示,希望得到的效果 顯示成了 aa cceeaaccee aaacceeaaccee aaacceeaaccee bbbcceeccee bbbcceeccee bbbddeeee bbbddff...