aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes ant paths and files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant paths and files" Watch "ant paths and files" New topic
Author

ant paths and files

John Cattanach
Greenhorn

Joined: May 29, 2007
Posts: 2
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30324
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
In fact, the copy task supports resource collections as inner elements, so you can use a path inside the copy task, too.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30324
    
150

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

Joined: Jul 11, 2001
Posts: 14112
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...
 
wood burning stoves
 
subject: ant paths and files