• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic Ant excludes question

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to copy some files from one directory to another with the exception of a sub-directory. I'm running ant in Eclipse and created a simple project to reproduce my problem.

Directories and files in Eclipse project:
build.xml
dir1/a.txt
dir1/dir2/b.txt
dir3/

I want to copy a.txt to dir3, but do not want to copy b.txt at all.

This is my build.xml:


Running the build.xml results in this file structure:
dir3/a.txt
dir3/dir2/b.txt

I know I must be missing something very basic. To me, the <exclude name="dir1/dir2/**" /> should prevent anything in dir1/dir2/ from being copied.

Thanks in advance for your help!
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be:


The exclude is relative to the fileset.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic