ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gale, Paul" <>
Subject Newbie question
Date Fri, 28 Sep 2001 19:35:42 GMT

Apologies if this the wrong forum:

I've been trying out Ant using the example from the doc, namely:

package com.mydomain;


public class MyVeryOwnTask extends Task {
  private String msg;

  // The method executing the task
  public void execute() throws BuildException {

  // The setter for the "message" attribute
  public void setMessage(String msg) {
    this.msg = msg;

and using the sample build.xml file provided. 

<?xml version="1.0"?>

<project name="OwnTaskExample" default="main" basedir=".">
  <taskdef name="mytask" classname="com.mydomain.MyVeryOwnTask"/>

  <target name="main">
    <mytask message="Hello World! MyVeryOwnTask works!"/> 

However, it fails to run, with the error:
 taskdef class com.mydomain.MyVeryOwnTask cannot be found

I have the class file in the same directory from where build.xml is executed
and on the classpath. 

I've tried removing the 'taskdef' element from the build.xml file and added
the MyVeryOwnTask.class file using jar.exe to jakarta-ant-1.4-optional.jar
and to the default properties file. Still nothing. 

What am I missing here? Something blatant no doubt, but I'm out of ideas.
I've checked all the doc and can't find a solution.

All help is much appreciated.


View raw message