Two Laptop Bag
The moose likes Ant, Maven and Other Build Tools and the fly likes Difference between fileset and pathelement 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 "Difference between fileset and pathelement" Watch "Difference between fileset and pathelement" New topic
Author

Difference between fileset and pathelement

Kanapathipillai Senthuran
Greenhorn

Joined: Dec 20, 2012
Posts: 1

Can anybody please explain the difference between pathelement and fileset in ant script?

I saw some ant script examples where they use both pathelement and fileset to include the jars and class files in class path.


<path id="classpath">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>

<pathelement path="${tomcat.lib}/servlet-api.jar" />
<pathelement path="${build}" />
</path>

Note: All the class files are located in build folder.



Thanks & Regards,
K.Senthuran
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32495
    
214

A fileset lets you search/accumulate things into one reference. A path element is one "thing." That think may be one file or a whole path. But it doesn't do wildcards like fileset does.

This is explained fairly well in path like structures.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Difference between fileset and pathelement
 
jQuery in Action, 3rd edition