Java ANT Question:
Download Questions PDF

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


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}/ file.
- Set the password – passwd = realpassword of the developer
- Master the 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}/ (personal)
3. projectdirectoryname/ (project team)
4. masterincludedirectory name/ (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?