Checksum issue in ant target

We use ant to build our system.

Part of our system build in development phase we always restore our database to the current production structure and apply the changes that are going to be part of the current release first followed by the code compile and unit and integration tests run.

Once we deploy on a test or production environment we use liquibase servlet to deploy our database changes.

Recently we changed our builds and liquibase servlet app to deploy our database changes using change log parameters. This is needed as developers and some test environments share the same database server but different schemas.

When running from liquibase servlet all is good you can stop and start the app multiple times the database changes are applied only first time as expected.

When applying the changes from our ant build first time when you apply a new change it runs OK any subsequent run it fails with a check sum violation. This is always happens when the change set uses change log parameters. To me it looks like the first time the check sum is calculated it substitutes the change log parameters before applying the change but then when running the database update target again it seems to be calculating the change check sum before the substitutions takes place or quite likely no substitution takes place at all.

Any idea about where should I look into. We are aware about setting the check sum to null or using any as a work around. However for this this is not an option.

We are using liquibase 3.5.3 however upgrading to the latest version fixed nothing.

Thank you in advance for your inputs.