This example illustrates how to convert path in to properties. In this example, refid is a reference to an object defined elsewhere in the file. The reference allows you to reuse the chunks of the build file so that common classpath and path can be shared among targets. Many tasks have a refid attribute assigning the value of reference object to the property name with the name attribute. In this example, the java file is converted from src directory to build directory and the lib directory refers to the common lib directory of apache tomcat home directory. The path of tomcat home is changed in to the property name. The source code of build.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
If you run the program, the following output will be generated.
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial
Discuss: Convert the path in to properties
Post your Comment