You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Abhishek Srivastava <ab...@india.hp.com> on 2001/04/01 10:18:45 UTC

Creating Jar files

Hello All,

I have the following directory structure

Root
 |
 |-A-- test1.class
 |
 |-B-- test2.class
 |
 |-C-- test3.class


I want to create a jar file that contains "only" the files in the directory
A. But not B and C or any other directory that may be present at the level
of A and B.

I tried the following command

<jar jarfile="module.jar" basedir="c:\test" includes="**/A" />

But The JAR I get has both the directories A and B and C.

Is there some way I can tell ant to include only A and ignore the rest of
the directories ?

regards,
Abhishek.

    *****     *****     Abhishek Srivastava
    ***  /_  __ ***     Hewlett-Packard - Solutions Organization
    **  / / /_/  **     19 Cunningham Road. Bangalore -560052.
    ***    /    ***     phone +91 80 2251554 Extn:1532
    *****     *****     mailto:abhisheks@india.hp.com
      i n v e n t

         The most exciting phrase in science, the one which heralds
         new discoveries, is not Eureka!! but 'That's Funny'
                                       -- Issac Asimov.



Re: Creating Jar files

Posted by Peter Donald <do...@apache.org>.
At 01:48  1/4/01 +0530, Abhishek Srivastava wrote:
>Hello All,
>
>I have the following directory structure
>
>Root
> |
> |-A-- test1.class
> |
> |-B-- test2.class
> |
> |-C-- test3.class
>
>
>I want to create a jar file that contains "only" the files in the directory
>A. But not B and C or any other directory that may be present at the level
>of A and B.
>
>I tried the following command
>
><jar jarfile="module.jar" basedir="c:\test" includes="**/A" />
>
>But The JAR I get has both the directories A and B and C.
>
>Is there some way I can tell ant to include only A and ignore the rest of
>the directories ?

What you want is 
<jar jarfile="module.jar" basedir="c:\test" includes="A/**" />

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*