ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 523] New - nested classpath not possible with taskdef
Date Mon, 05 Feb 2001 07:01:03 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=523

*** shadow/523	Sun Feb  4 23:01:02 2001
--- shadow/523.tmp.6954	Sun Feb  4 23:01:02 2001
***************
*** 0 ****
--- 1,102 ----
+ +============================================================================+
+ | nested classpath not possible with taskdef                                 |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 523                         Product: Ant                     |
+ |       Status: NEW                         Version: 1.2                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority: Medium                    Component: Build Process           |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: jtfox@usa.net                                                |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Either I have found a bug with taskdef or I am botching the systax of
+ classpath elements.
+ 
+ I can define classpath as an attribute of taskdef, but I cannot define
+ classpath in a nested <classpath> tag.
+ 
+ Here is an example I built to illustrate this.
+ 
+ I make a class ant_test.SysOutTask by copying the example MyVeryOwnTask
+ given in the docs.
+ 
+ The class is located at c:\AntTests\ant_test\SysOutTask.class and also
+ within the jar c:\AntTests\sysout.jar.
+ 
+ I place build.xml (text below) in c:\AntTests\run (not in c:\AntTests, since
+ present working directory is in the classpath for Ant anyway.)
+ 
+ I run ant.
+ 
+ I find that when classpath is defined as an attribute, Ant finds the class,
+ but when classpath is a nested element,  I get
+ java.lang.ClassNotFoundException: ant_test.SysOutTask
+         at java.lang.Throwable.<init>(Throwable.java:96)
+ 
+ Replacing backslash with slash does not help.
+ 
+ Sincerely,
+ 
+ 
+ Joshua Fox
+ 
+ 
+ ////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////
+ 
+ 
+ Here is build.xml: Uncomment appropriately to test taskdefs. I have
+ indicated which taskdefs are OK and not OK.
+ 
+ 
+ 
+ <?xml version = "1.0" encoding = "UTF-8"?>
+ <project name="simple" default="do_all" basedir="c:/ant_test">
+ 
+ <!--  OK: -->
+ 
+  <taskdef name="sysout"
+   classname="ant_test.SysOutTask"
+   classpath="C:\AntTests"
+  >
+  </taskdef>
+ 
+ <!-- *************************************** -->
+ <!--  OK: -->
+ <!--
+  <taskdef name="sysout"
+   classname="ant_test.SysOutTask"
+   classpath="C:\AntTests\sysout.jar"
+  >
+  </taskdef>
+ 
+ -->
+ 
+ <!-- *************************************** -->
+ <!-- Not OK: -->
+ <!--
+  <taskdef name="sysout"
+   classname="ant_test.SysOutTask"
+  >
+   <classpath path="C:\AntTests" />
+  </taskdef>
+ -->
+ 
+ <!-- *************************************** -->
+ <!-- Not OK: -->
+ <!--
+  <taskdef name="sysout"
+   classname="ant_test.SysOutTask"
+  >
+   <classpath>
+         <pathelement path="C:\AntTests\sysout.jar"  />
+      </classpath>
+  </taskdef>
+ -->
+    <target name="do_all" />
+ </project>

Mime
View raw message