From 5306e0b587e88197239d068389990d578919732e Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 19 Oct 2001 07:51:14 +0000 Subject: [PATCH] improve "could not create task" error message. PR: 3919 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269809 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/UnknownElement.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/org/apache/tools/ant/UnknownElement.java b/src/main/org/apache/tools/ant/UnknownElement.java index 6568e8b43..0d27cbc44 100644 --- a/src/main/org/apache/tools/ant/UnknownElement.java +++ b/src/main/org/apache/tools/ant/UnknownElement.java @@ -148,14 +148,17 @@ public class UnknownElement extends Task { protected Task makeTask(UnknownElement ue, RuntimeConfigurable w) { Task task = project.createTask(ue.getTag()); if (task == null) { - log("Could not create task of type: " + elementName + " Common solutions" + - " are adding the task to defaults.properties and executing bin/bootstrap", - Project.MSG_DEBUG); - throw new BuildException("Could not create task of type: " + elementName + - ". Common solutions are to use taskdef to declare" + - " your task, or, if this is an optional task," + - " to put the optional.jar in the lib directory of" + - " your ant installation (ANT_HOME).", location); + String lSep = System.getProperty("line.separator"); + String msg = "Could not create task 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)."; + throw new BuildException(msg, location); } task.setLocation(getLocation());