Using a separate property file in Ant Script

Hi,

The below example will demonstarte usage of a separate property file in Ant Script

Step1: Define a property file.
File: build.properties
——————————
server.name=localhost
server.port=8080
server.scheme=http
——————————–

Step 2: Write ANT Script
File: build.xml
—————————————
<?xml version=”1.0″?>
<project name=”MyProject”basedir=”.”>
<target name=”properties.localfile”>
<property file=”build.properties”/> <!– Loads the property file –>
<echo message=”Server URL: ${server.url}”/>
<echo message=”Server Port: ${server.port}”/>
<echo message=”Server Scheme: ${server.url}”/>
</target>
</project>
————————————-

Thanks
R Vashis

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.