Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 82668 invoked from network); 23 Dec 2005 07:50:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Dec 2005 07:50:33 -0000 Received: (qmail 53457 invoked by uid 500); 23 Dec 2005 07:50:27 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 53376 invoked by uid 500); 23 Dec 2005 07:50:26 -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 53365 invoked by uid 99); 23 Dec 2005 07:50:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2005 23:50:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of paranoiabla@gmail.com designates 66.249.82.192 as permitted sender) Received: from [66.249.82.192] (HELO xproxy.gmail.com) (66.249.82.192) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2005 23:50:25 -0800 Received: by xproxy.gmail.com with SMTP id t15so338863wxc for ; Thu, 22 Dec 2005 23:50:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=mWOHqNBb9q5MQPlzlMC6aI0GVaYQc3tsp7uWaIzfs77wZycmxZuVyn/MqVpl8SFnxcN2FIJP/LDGFggluoo82+DWSaLsEX7FFpKQS9/ZjnGrpMpe+/Omdf5DU/vgsItPpQRdFHtY0RBCob0ssfJDefGr7acChJi0nTXxkAXfMKQ= Received: by 10.70.99.13 with SMTP id w13mr2732097wxb; Thu, 22 Dec 2005 23:50:04 -0800 (PST) Received: by 10.70.90.3 with HTTP; Thu, 22 Dec 2005 23:50:04 -0800 (PST) Message-ID: Date: Fri, 23 Dec 2005 07:50:04 +0000 From: Petar Tahchiev To: Ant Users List Subject: Re: How to get user project properties from java In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21238_9163689.1135324204641" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_21238_9163689.1135324204641 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 22/12/05, Antonio, Jean Claude (Spring IT) < jeanclaude.antonio-eds@eds.com> wrote: > > Hello, > > I'm writing a java application that call ant. > It works fine. > But I want to get project properties defined in the build.xml file. > > With project.getUserProperty("serverName"); > or project.getProperty("serverName"); > I get a returned null value. > > ---------------------------------------------------------------- > > > > > > Project project=3D new Project(); > ProjectHelper helper =3D new ProjectHelperImpl(); > project.init(); > helper.parse(antProject, new File("build.xml")); > > project.getUserProperty("serverName"); > > ---------------------------------------------------------------- > Cheers > > I think you should use the project.getProperty("Blah") method here instead of project.getUserProperty("Blah"). Ant API says: getUserProperty - Returns the value of a user property, if it is set. getProperty - Returns the value of a property, if it is set. -- Regards, Petar! ------=_Part_21238_9163689.1135324204641--