I am looking forward for an example which unjars a file referenced from the classpath inside the ANT. I couldn't find any example开发者_如何转开发 in the web. When I tried using the path inside the unjar target, it unjars all the jar files inside the classpath. Can anyone suggest me something giving some example ?
You have to specify the jar name which you what to unjar.
Probably you have wildcard(*) in your src
This will unjar all jars in ${ant.home}/lib/
<unzip src="${ant.home}/lib/*.jar" dest="..."/>
I think you should use:
<unzip src="${ant.home}/lib/ant.jar" dest="..."/>
If you want to unjar some files from your jar look at this example:
<unzip src="${ant.home}/lib/ant.jar" dest="...">
<patternset>
<include name="**/ant_logo_large.gif"/>
<include name="**/LICENSE.txt"/>
</patternset>
</unzip>
Look at unzip task documentation
精彩评论