Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 8227 invoked from network); 30 Jul 2007 17:35:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jul 2007 17:35:28 -0000 Received: (qmail 51643 invoked by uid 500); 30 Jul 2007 17:35:25 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 51134 invoked by uid 500); 30 Jul 2007 17:35:24 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 51123 invoked by uid 99); 30 Jul 2007 17:35:23 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jul 2007 10:35:23 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peter.kitt.reilly@gmail.com designates 209.85.128.189 as permitted sender) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jul 2007 17:35:16 +0000 Received: by fk-out-0910.google.com with SMTP id 18so206645fks for ; Mon, 30 Jul 2007 10:34:55 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WRaE1oGYDiE/y8EV2RxZkDQDCNnqMQIqg6X63W3ExXXuYOgCyh77N1Urv0ew8DOifLwiztbOlbUygMiehBKIGj2qFIg//oq3Ww2m/erm7rNA70IPRYO+YdyFBPHX+3rncWguoC2PrwwQZpLSRwNqUcw1I14ZekCH7mWLhXBQLJs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OeF1O1MRt5XI1alhSwNgXDSdCCWOODjyzIck/alh/hssMw+v295HxyzmUYK38jZ9R9MLIU3Xl7/CpugpKEjpX4jeW0FGRW3S/X08uvjd8YjY212/NpKwK8AR110Tr7mZxBiKRObhoDbQj3pATk3HSl8MPVrXcxWFxZlu9UX5rSY= Received: by 10.82.105.13 with SMTP id d13mr4624424buc.1185816894824; Mon, 30 Jul 2007 10:34:54 -0700 (PDT) Received: by 10.82.117.3 with HTTP; Mon, 30 Jul 2007 10:34:54 -0700 (PDT) Message-ID: Date: Mon, 30 Jul 2007 18:34:54 +0100 From: "Peter Reilly" To: "Ant Users List" Subject: Re: Getting classpath attribute of custom task In-Reply-To: <11866788.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11866788.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org The classpath attribute is not available to the created task. In the task one can use MyTask.class.getClassLoader() to get the classloader that loaded the task. If this is of type AntClassloader, one can use AntClassloader.getClassPath() to get the path used in the loader. However there are a number of issues with this: - the MyTask may be in a system classpath, or other classpath - in which case, the classloader seen will not be the classloader used by - there must be other means to achive the same goal. - for example keep a reference to the path use use this refernce for the task. Peter On 7/30/07, stanS wrote: > > Lets say I have a taskdef in the build.xml > classname="MyTask" > classpath="path-to/my.jar" /> > > How do I get the 'classpath' part in the custom task that derived from Ant > Task class? > Could you point me to the right API? > > I want to use that classpath back with a 'java' task. > > Thanks > Stan. > > -- > View this message in context: http://www.nabble.com/Getting-classpath-attribute-of-custom-task-tf4171205.html#a11866788 > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org