Java ANT Question:
Download Questions PDF

Tell me how does ant read properties? How to set my property system?

ANT Interview Question
ANT Interview Question

Answer:

Properties in ant are set in an order. Once a property is set, later the same property can not overwrite the previous one.

This process provides a good leverage of presetting all properties in one location, and overwriting only the needed properties. For instance, a password is to be used for an application task, and the developer does not want to share the password with his team members or developers of other teams. The following is the process to do the task:

- Store the password in ${user.home}/prj.properties file.
- Set the password – passwd = realpassword of the developer
- Master the prj.properties in include directory
passwd = password
- Read the property files in the following order in the build.xml file
1. Type ant –Dpasswd=newpassword
2. ${user.home}/prj.properties (personal)
3. projectdirectoryname/prj.properties (project team)
4. masterincludedirectory name/prj.properties (universal)

<cvsnttaskpasswd=${password=passwd} … />

Download ANT Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know how to modify properties in ant?What is the concepts and capabilities of ANT?