@@ -344,6 +344,10 @@ find-in-jars 'log4j\.properties$' -d /path/to/find/directory
344344# 支持多个查找目录
345345find-in-jars 'log4j\.properties' -d /path/to/find/directory1 -d /path/to/find/directory2
346346
347+ # -a选项 指定 查找结果中的Jar文件使用绝对路径
348+ # 分享给别人时,Jar文件路径是完整的,方便别人找到文件
349+ find-in-jars 'log4j\.properties' -a
350+
347351# 帮助信息
348352$ find-in-jars -h
349353Usage: find-in-jars [OPTION]... PATTERN
@@ -358,12 +362,13 @@ Example:
358362
359363Options:
360364 -d, --dir the directory that find jar files, default is current directory.
361- this option can specify multiply times to find in multiply directory .
365+ this option can specify multiply times to find in multiply directories .
362366 -E, --extended-regexp PATTERN is an extended regular expression (*default*)
363367 -F, --fixed-strings PATTERN is a set of newline-separated strings
364368 -G, --basic-regexp PATTERN is a basic regular expression
365369 -P, --perl-regexp PATTERN is a Perl regular expression
366370 -i, --ignore-case ignore case distinctions
371+ -a, --absolute-path always print absolute path of jar file
367372 -h, --help display this help and exit
368373` ` `
369374
@@ -376,23 +381,18 @@ Options:
376381$ find-in-jars ' log4j\.properties$'
377382./hadoop-core-0.20.2-cdh3u3.jar! log4j.properties
378383
379- # 查找出 以Service结尾的类
380- $ ./ find-in-jars ' Service.class$'
381- . /WEB-INF/libs/spring-2.5.6.SEC03.jar! org/springframework/stereotype/Service.class
382- ./ rpc-benchmark -0.0.1-SNAPSHOT.jar! com/taobao/rpc/benchmark/service /HelloService.class
384+ # 查找出 以Service结尾的类,Jar文件路径输出成绝对路径
385+ $ find-in-jars ' Service.class$' -a
386+ /home/foo/deploy/app /WEB-INF/libs/spring-2.5.6.SEC03.jar! org/springframework/stereotype/Service.class
387+ /home/foo/deploy/app/WEB-INF/libs/ rpc-hello -0.0.1-SNAPSHOT.jar! com/taobao/biz /HelloService.class
383388......
384389
385390# 在指定的多个目录的Jar文件中,查找出 properties文件
386- $ find-in-jars ' \.properties$' -d ../WEB-INF/lib -d ../deploy/lib | grep -v ' /pom\.properties$'
387- ../WEB-INF/lib/aspectjtools-1.6.2.jar! org/aspectj/ajdt/ajc/messages.properties
388- ../WEB-INF/lib/aspectjtools-1.6.2.jar! org/aspectj/ajdt/internal/compiler/parser/readableNames.properties
389- ../WEB-INF/lib/aspectjweaver-1.8.8.jar! org/aspectj/weaver/XlintDefault.properties
390- ../WEB-INF/lib/aspectjweaver-1.8.8.jar! org/aspectj/weaver/weaver-messages.properties
391+ $ find-in-jars ' \.properties$' -d WEB-INF/lib -d ../deploy/lib | grep -v ' /pom\.properties$'
392+ WEB-INF/lib/aspectjtools-1.6.2.jar! org/aspectj/ajdt/ajc/messages.properties
393+ WEB-INF/lib/aspectjweaver-1.8.8.jar! org/aspectj/weaver/XlintDefault.properties
391394../deploy/lib/groovy-all-1.1-rc-1.jar! groovy/ui/InteractiveShell.properties
392- ../deploy/lib/groovy-all-1.1-rc-1.jar! org/codehaus/groovy/tools/shell/CommandAlias.properties
393395../deploy/lib/httpcore-4.3.3.jar! org/apache/http/version.properties
394- ../deploy/lib/httpmime-4.2.2.jar! org/apache/http/entity/mime/version.properties
395- ../deploy/lib/javax.servlet-api-3.0.1.jar! javax/servlet/LocalStrings_fr.properties
396396../deploy/lib/javax.servlet-api-3.0.1.jar! javax/servlet/http/LocalStrings_es.properties
397397......
398398` ` `
0 commit comments