terbooter
terbooter

Reputation: 399

Ant property bug

I have two deployment configurations. Each configuration store in its property file. Dev configuration in dev.properties:

deploy.wowza.domain=DEV_IP_ADDRESS

Prod configuration in prod.properties:

deploy.wowza.domain=PROD_IP_ADDRESS

I have build.xml

<?xml version="1.0"?>
<project name="MAIN" default="dev" basedir=".">    
<target name="dev">
        <property file="${java.root.dir}/ant/dev.properties"/>

        <echo>
            DEV
            ${deploy.wowza.domain}
        </echo>
        <sleep seconds="1"/>

    </target>

    <target name="prod">
        <property file="${java.root.dir}/ant/prod.properties"/>

        <echo>
            PROD
            ${deploy.wowza.domain}
        </echo>

        <antcall target="deploy"/>

    </target>
</project>

If I run prod or dev task it show correct property value only from second run

D:\Dropbox\camwithme>ant prod
Buildfile: D:\Dropbox\camwithme\build.xml

prod:
     [copy] Copying 1 file to D:\Dropbox\camwithme\wowza_cam\ant
     [echo]
     [echo]             PROD
     [echo]             PROD_IP_ADDRESS
     [echo]

BUILD SUCCESSFUL
Total time: 0 seconds

D:\Dropbox\camwithme>ant dev
Buildfile: D:\Dropbox\camwithme\build.xml

dev:
     [copy] Copying 1 file to D:\Dropbox\camwithme\wowza_cam\ant
     [echo]
     [echo]             DEV
     [echo]             PROD_IP_ADDRESS     !!! Should be dev ip here !!!
     [echo]

BUILD SUCCESSFUL
Total time: 0 seconds

D:\Dropbox\camwithme>ant prod
Buildfile: D:\Dropbox\camwithme\build.xml

prod:
     [copy] Copying 1 file to D:\Dropbox\camwithme\wowza_cam\ant
     [echo]
     [echo]             PROD
     [echo]             DEV_IP_ADDRESS
     [echo]

Upvotes: 0

Views: 138

Answers (1)

terbooter
terbooter

Reputation: 399

Problem was because of another build.xml which load properties files before copy

Upvotes: 1

Related Questions