30

Can anyone tell me the difference between <exec> and <apply> in Apache Ant?

Maxim Masiutin
  • 3,991
  • 4
  • 55
  • 72
Matty F
  • 3,763
  • 4
  • 30
  • 48

1 Answers1

38

The main difference is that apply works for a resource collection - fileset, dirset and the like - so you can, for example, run a script once for each member of a fileset. exec doesn't operate on a fileset; each instance of the task only runs a single external program. Otherwise the tasks are quite similar.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
  • 4
    This is why I love stackoverflow. For programming it, it works way better than plain googling. =) – sjas Feb 24 '13 at 06:04