I've trying to get buildCommon.xml to work. Something new happened when I placed: <buildCommon> ...the whole file.... </buildCommon> When I type 'ant' now, I get this message: Ant Could not find the task or a class this task relies upon. This is common and has a number of causes; the usual solutions are to read the manual pages then download and install needed JAR files, or fix the build file: 1-You have misspelt 'buildCommon' Fix: check your spelling. 2-The task needs an external JAR file to execute and this is not found at the right place in the classpath. Fix: check the documentation for dependencies. Fix: declare the task. 3-The task is an Ant optional task and optional.jar is absent Fix: look for optional.jar in ANT_HOME/lib, download if needed 4-The task was not built into optional.jar as dependent libraries were not found at build time. Fix: look in the JAR to verify, then rebuild with the needed libraries, or download a release version from apache.org 5-The build file was written for a leter version of Ant Fix: upgrade to at least the latest release version of Ant 6-The task is not an Ant core or optional task and needs to be declare using <taskdef>
7-Remember that for JAR files to be visible to Ant task implemented in ANT_HOME/lib, the files must be in the same direcotry or on the classpath
8-Please neither file bug reports on this problem, nor email the Ant mailing lists, until all of these causes have been explored, as this is not an Ant bug My solution to each point: 1- I double checked and made sure buildCommon is spelled correctly. 2- I made sure all my JAR files in the correct directory. 3- Ant 1.6 already has optional.jar in ANT_HOME/lib 4- I don't exactly know what that means. 5- Already have the latest Ant version. 6- I don't know how to declare using <taskdef> 7- All my JAR files in ANT_HOME/lib 8- Now I'm confused why am I posting this in the Ant forum if it isn't?! It could've been that I've placed <buildCommon> tags around the file that caused the problem. So does that mean I'm going a step backwards! Thanks for reading.
Never heard of an ant tag "<buildCommon>". Are you assuming this tag is magic and is somehow connected to a file named "buildCommon.xml"?
Joined: Jan 25, 2004
Basically, I have 2 build.xml files; one is outside the Framework/Lab, and one inside Framework/Lab (with web.xml). Framework/Lab is the folder where I keep all the codes for my shopping cart. The build.xml file outside Framework/Lab (ie. in C is with a file called buildCommon.xml. build.xml in the Framework\Lab directory uses an external entity to basically import buildCommon.xml that is in the top directory. That file defines where many libraries like Xerces, Tomcat and Xalan etc should be found. The reason I set it up this way is that I might have more than one lab exercise that share common build features and I didn't want each one to have to repeat all of that.
Joined: Jan 27, 2004
Then you include it like this:
Again, just because you have a file named "buildCommon.xml" doesn't magically create a tag called <buildCommon>.