0

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 ?

1 Answers1

0

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

Krzysztof Miksa
  • 1,519
  • 1
  • 16
  • 23
  • Here you are looking for the jars as the absolute path. What I need is to refer the jar using classpath. I don't have the absolute path of the jar except the name of the jar to do unjar. And also the classpath is given to script, script is not generating the classpath. – user534670 Dec 10 '10 at 04:24