I was wrong, this did not work as expected - I had JAVA_HOME pointing to a non 1.2 JDK.
Can anyone see what is wrong with the attached and why the regexp.jar was not found and added? If I set this exact same path as the CLASSPATH value before invoking ant, it works. Is the class being interpretted before the classpath can be determined or is ant ignoring the declaration as the class is already loaded? Thanks, Nestor -----Original Message----- From: Nestor Dutko [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 24, 2005 12:52 PM To: 'Ant Users List' Subject: RE: Adding to the ant classpath from within a project I tried the dummy task or type definition, but it really requires the class specified to implement the execute or other methods. So, I have done the following <typedef name="_regexp_foo" classname="org.apache.tools.ant.types.RegularExpression"> <classpath> <pathelement location="${liveLink.root}/dependencies/regexp.jar"/> <pathelement location="${ant.home}/lib/ant.jar"/> </classpath> </typedef> Yes, I realize that the regexp type is defined in the ant.jar and that the ant.jar is already in the classpath, but this at least allows me to add to the classpath satisfying the requirements I stated earlier. -----Original Message----- From: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 23, 2005 4:59 PM To: Ant Users List Subject: Re: Adding to the ant classpath from within a project I am not sure, what problem you are trying to solve. Somewhere there should be a logic to include the jar or not. Can you move it outside of ANT script? If no, you can create dummy task and <taskdef> it. Or you can try to add your jar to classpath of some other innocent <taskdef>. - Alexey. Nestor Dutko wrote: > I should have added this - this jar does not contain any typedef or > tasks to be defined. It actually contains the regexp implementation > that I just want to have added to the ant classpath. > > Can I use taskdef/typedef without defining a task or type? > > -----Original Message----- > From: Alexey N. Solofnenko [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 23, 2005 4:06 PM > To: Ant Users List > Subject: Re: Adding to the ant classpath from within a project > > <taskdef> and <typedef> > (http://ant.apache.org/manual/CoreTasks/typedef.html) have classpath > attribute. You can execute it within a target or within ANT-Contrib's > <if> task in a global scope. > > - Alexey. > > Nestor Dutko wrote: > >> I've looked around at this and understand the mechanisms that nat has >> for extending types (via typedef) and tasks (via taskdef). >> >> I have a condition where I want to use the propertyregexp task. I >> compile using JDK1.2. I also have the apache regexp.jar. I have read >> on how to add my own task definition and defining with regexpimpl to >> use via the ant -D mechanism. >> >> What I want to do is >> >> - augment just ant's classpath to include regexp.jar >> - do this without: >> >> adding the file to $ANT_HOME/lib >> adding the file to ~/.ant tree >> setting CLASSPATH to point to the location of the file before >> invoking ant. >> >> Is there some way that I can cause the ant classloader to know about >> a generic JAR file to be added if the jar file does not have a type >> or task definition? >> >> Thanks, >> Nestor >> >> >> > > -- > ---------------------------------------------------------------------- > -- > / Alexey N. Solofnenko > MDL Information Systems, Inc. > work: 510-357-2222x1726 > home: http://trelony.cjb.net/ > / > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] For additional > commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] For additional > commands, e-mail: [EMAIL PROTECTED] > -- ------------------------------------------------------------------------ / Alexey N. Solofnenko MDL Information Systems, Inc. work: 510-357-2222x1726 home: http://trelony.cjb.net/ / --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]