From f9e2c884babcb11e65fdc2317705993ea839c286 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Sun, 3 Feb 2002 07:49:37 +0000 Subject: [PATCH] handy helpful tips for users, along with a 'please leave us alone' plea git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271117 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/UnknownElement.java | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index 8186a4f11..33f4fdf24 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -213,18 +213,38 @@ public class UnknownElement extends Task { String elementName) { String lSep = System.getProperty("line.separator"); String msg = "Could not create " + what + " of type: " + elementName - + "." + lSep - + "Ant could not find the task or a class this" + lSep - + "task relies upon." + lSep - + "Common solutions are to use taskdef to declare" + lSep - + "your task, or, if this is an optional task," + lSep - + "to put the optional.jar and all required libraries of" +lSep - + "this task in the lib directory of" + lSep - + "your ant installation (ANT_HOME)." + lSep - + "There is also the possibility that your build file " + lSep - + "is written to work with a more recent version of ant " + lSep - + "than the one you are using, in which case you have to " + lSep - + "upgrade."; + + "." + lSep+ lSep + + "Ant could not find the task or a class this " + + "task relies upon." + lSep +lSep + + "This is common and has a number of causes; the usual " + lSep + + "solutions are to read the manual pages then download and" + lSep + + "install needed JAR files, or fix the build file: "+ lSep + + " - You have misspelt '" + elementName + "'." + lSep + + " Fix: check your spelling." +lSep + + " - The task needs an external JAR file to execute" +lSep + + " and this is not found at the right place in the classpath." +lSep + + " Fix: check the documentation for dependencies." +lSep + + " - The task is not an Ant core or optional task " +lSep + + " and needs to be declared using ." +lSep + + " Fix: declare the task." +lSep + + " - The task is an Ant optional task and optional.jar is absent"+lSep + + " Fix: look for optional.jar in ANT_HOME/lib, download if needed" +lSep + + " - The task was not built into optional.jar as dependent" +lSep + + " libraries were not found at build time." + lSep + + " Fix: look in the JAR to verify, then rebuild with the needed" +lSep + + " libraries, or download a release version from apache.org" +lSep + + " - The build file was written for a later version of Ant" +lSep + + " Fix: upgrade to at least the latest release version of Ant" +lSep + + lSep + + "Remember that for JAR files to be visible to ant tasks implemented" +lSep + + "in ANT_HOME/lib, the files must be in the same directory or on the" +lSep + + "classpath"+ lSep + + lSep + + "Please do not file bug reports on this problem, nor email the" +lSep + + "ant mailing lists, until all of these causes have been explored," +lSep + + "as this is not an Ant bug."; + + return new BuildException(msg, location); }