• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant paths and files

 
John Cattanach
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34667
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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
Marshal
Posts: 34667
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic