From dev-return-84166-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Thu Apr 23 06:53:56 2009 Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 63381 invoked from network); 23 Apr 2009 06:53:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Apr 2009 06:53:56 -0000 Received: (qmail 35601 invoked by uid 500); 23 Apr 2009 06:53:55 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 35510 invoked by uid 500); 23 Apr 2009 06:53:55 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 35500 invoked by uid 99); 23 Apr 2009 06:53:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 06:53:54 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gscokart@gmail.com designates 209.85.220.159 as permitted sender) Received: from [209.85.220.159] (HELO mail-fx0-f159.google.com) (209.85.220.159) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 06:53:48 +0000 Received: by fxm3 with SMTP id 3so396420fxm.28 for ; Wed, 22 Apr 2009 23:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Z3K3vTD/onDeW62UUL7yXsqmpBxfQkJoiyjMWvMCr68=; b=pkiIxHostJJlRvahDoC6YmlkNe7Ug1jL3dSnSiNvmV4QpPeUlgXgD3PUDhurcLDLR3 ps5VbZOiyc5IXbeSvBhVZJqDozE/ynzEJvvPlKnENPiWSEWT2Vaa5Q++yTIpSYr36x2W MEbVLfjxUQIQdwmgOpuSdVllpfo7xXbQ2lHWs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=WMsDNQZFBXyrV0G0FPuNFBK+MUFnahiapM+CGzKNDcJaOfSqNL1pBAc7VSPyQLp4ug IMd8tLZhyxagWEyqmgnuQKQHVAA24zh+ph2fcWU3+M6t5qBbilEB+DwTAwN3B3F7Hp90 sDbhSwVp0V/tyWQb+dFRC6IhNJ3T3HEHj2P/Q= MIME-Version: 1.0 Received: by 10.223.106.15 with SMTP id v15mr200801fao.15.1240469606480; Wed, 22 Apr 2009 23:53:26 -0700 (PDT) Date: Thu, 23 Apr 2009 08:53:26 +0200 Message-ID: Subject: antlib namespace and uri usage From: Gilles Scokart To: Ant Developers List Content-Type: multipart/alternative; boundary=001636c5bf723fbcbd04683356e0 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5bf723fbcbd04683356e0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Yesterday I lost 1 hour to fix an antlib namespace issue. I have no found how to fix it, but I still don't clearly understand what is actually wrong (=what error message should ant report). I have an antlib defined in an XML file like this : And I have my project was using it like this : This was working fine, and I could use task in my build. But then I added a presetdef in my anlib that refined analyze like this (simplified version): This was failing because deco:analyze was not found when presetdef executed. I tried unsuccesfully to change the usage of the namespace in different way, then I plugged a debugger and I found that the analyze task did exist, but with the name net.sourceforge.deco.ant:analyze while antlib:net.sourceforge.deco.ant:analyze was searched. The fix was to change the uri used in my build from net.sourceforge.deco.ant to antlib:net.sourceforge.deco.ant. But what is exactly wrong? Was my initial declaration wrong? Should it be mandatory to use exactly the same URI in the typedef loading the antlib than in the antlib declaration For the moment it is not mandatory, If you don't do, you may not notice that you don't do. But you might have the issue I had. In that case, we should at least have a warning (failing would break backward compatibility). Or are was it the intention to let the user of an antlib freely choose its uri? I doubt. But if it is, how can I reference my own tasks into the antlib.xml file ? Gilles Scokart --001636c5bf723fbcbd04683356e0--