ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy Lambert <>
Subject Re: ANT Custom tasks - difference between using getProject() and "new Project()"
Date Mon, 27 May 2013 14:34:38 GMT


in a custom task you usually do not need to use a new Ant project instance, so I would use
getProject() to access the project attached to the current ant task.

If you are programming a piece of code to execute  an Ant task or ant Ant build file from
a Java class or framework which is not related to Ant, you would create a new Project instance.



On May 26, 2013, at 10:41 AM, WebServices Development wrote:

> I am trying to create a custom ant task to copy files to a specified location based on
some criteria provided to the task.   
> I am using ANT's Copy task for my custom task.  I have seen some discussion about using
one of the two - getProject() and "new Project()" but haven't found any discussion on differences
between when to use which of these approaches.  I realise the basic difference is getting
reference to an existing project vs. creating a new reference, but other than that haven't
found any information.
> Is there a specific reason to use one vs. the other?
> Thank you

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message