• 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

ant paths and files

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, this is driving me nuts - is there anyway to use a path-like structure in a copy task?

Scenario is I have a classpath reference which I use for compiling. I'm building a war, so I also need to copy these files into WEB-INF/lib. It would be nice if I only had to define the list of jars once, but as afar as I can determine, if the jars are in multiple directories I cannot use any ant type which can be both path-like and input to <copy> .

I can get around it by copying the files first, then referencing the WEB-INF/lib during the compiling. But to my mind it would be much neater to have a single <files id="externaljars" .... definition.
 
author & internet detective
Posts: 41878
909
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
John,
A <classpath> can contain a fileset element. So you could create a path that contains a single fileset with a reference to your standalone fileset.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In fact, the copy task supports resource collections as inner elements, so you can use a path inside the copy task, too.
 
Jeanne Boyarsky
author & internet detective
Posts: 41878
909
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
Ilja,
Is that from the resource framework that was introduced with Ant 1.7? Some people are still on 1.6. I infer that John is from his description of the problem.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:
Ilja,
Is that from the resource framework that was introduced with Ant 1.7? Some people are still on 1.6. I infer that John is from his description of the problem.



Could be, could be...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic