Tell me how does ant read properties? How to set my property system?
Submitted by: AdministratorProperties 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} … />
Submitted by: Administrator
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} … />
Submitted by: Administrator
Read Online Java ANT Job Interview Questions And Answers
Top Java ANT Questions
☺ | Tell me how to set classpath in ant? |
☺ | How to write your own ant task? |
☺ | Do you know how to debug my ant script? |
☺ | How to use ant to run a Java application? |
☺ | Tell me how to use Runtime in ant? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |