Linux下用jar命令更新jar包文件


jar -uvf SDK_Web_ChartReport.war  view/global/header.jsp
echo '樣式文件替換進包中'
 
查看jar包中的文件:
jar -tvf SDK_Web_Common-4.0-SNAPSHOT.jar | grep HostPerfListSqlCreator.class
unzip -v SDK_Web_Common-4.0-SNAPSHOT.jar | grep HostPerfListSqlCreator.class
 

 

 

=========================================================

jar命令各個參數的詳細介紹
   -c  建立新的歸檔
    -t  列出歸檔的目錄
    -x  從歸檔中擷取已命名的 (或所有) 檔案
    -u  更新現有歸檔
     -v  在標准輸出中產生詳細輸出
    -f  指定歸檔檔案名稱
    -m  包含指定清單檔案中的清單資訊
    -e  為獨立應用程式指定應用程式進入點
        已隨附於可執行 jar 檔案中
    -0  僅儲存;不使用 ZIP 壓縮方式
    -M  不為項目建立清單檔案
    -i  為指定的 jar 檔案產生索引資訊
    -C  變更至指定目錄並包含後面所列的檔案
 
 
===================================================

[root@Test-SDK4 SDK_Web_Alert]# unzip -h
UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.

Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
Default action is to extract files in list, except those in xlist, to exdir;
file[.zip] may be a wildcard. -Z => ZipInfo mode ("unzip -Z" for usage).

-p extract files to pipe, no messages -l list files (short format)
-f freshen existing files, create none -t test compressed archive data
-u update files, create if necessary -z display archive comment only
-v list verbosely/show version info -T timestamp archive to latest
-x exclude files that follow (in xlist) -d extract files into exdir
modifiers:
-n never overwrite existing files -q quiet mode (-qq => quieter)
-o overwrite files WITHOUT prompting -a auto-convert any text files
-j junk paths (do not make directories) -aa treat ALL files as text
-U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields
-C match filenames case-insensitively -L make (some) names lowercase
-X restore UID/GID info -V retain VMS version numbers
-K keep setuid/setgid/tacky permissions -M pipe through "more" pager
-O CHARSET specify a character encoding for DOS, Windows and OS/2 archives
-I CHARSET specify a character encoding for UNIX and other archives


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM