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

时间:2020-12-04 15:59:40
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
 
Linux下用jar命令更新jar包文件

 

 

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

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