ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: How to get user project properties from java app
Date Thu, 22 Dec 2005 18:35:52 GMT
You should probably send this question to the dev list.

-Rob Anderson 

> -----Original Message-----
> From: Antonio, Jean Claude (Spring IT) 
> [mailto:jeanclaude.antonio-eds@eds.com] 
> Sent: Thursday, December 22, 2005 9:46 AM
> To: user@ant.apache.org
> Subject: How to get user project properties from java app
> 
> 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.
> 
> ----------------------------------------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?> <project 
> name="InitialProject" basedir="." default="clear">
> 	    <property name="serverName"     value="localhost"/>
> 
> 
> Project project= new Project();
> ProjectHelper helper = new ProjectHelperImpl(); 
> project.init(); helper.parse(antProject, new File("build.xml"));
> 
> project.getUserProperty("serverName");
> 
> ----------------------------------------------------------------
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message