开发者

How to unjar a file referencing it from the classpath in ANT > 1.7 but < 1.8

开发者 https://www.devze.com 2023-01-29 15:51 出处:网络
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 u

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号