--defaultsFile doesn't load the correct file

I have a few “.properties” files in the same directory and use the “–defaultsFile” parameter to specify its name during my build process.

Right now if I have the following files:

  • Project.properties
  • Project.LOCAL.properties

liquibase will always use “Project.LOCAL.properties” even if I specify “Project.properties” in the command line.

Works fine with liquibase 2.0 RC2 (dated 2010/July/11).

Could you try it wiht the latest RC6 from http://liquibase.org/download?  I think I remember it being an issue fixed in the last couple months.

Nathan

That was the version I tested with originally. I downloaded it again just to make sure and the bug is definitely there.

You can test it with the 2 attached files and with the command:

    liquibase --defaultsFile=project.properties updateSQL

It should complain about “y”, not “x”.
Unless I’m missing something, of course. :slight_smile:

Thanks

In this case, it really is a feature, not a bug :slight_smile:

Since there are many cases where you have a standard properties file, but there are a couple fields that change per machine, we have a feature that if you specify a file x.properties, liquibase will also look for an x.local.properties file in addition to x.properties, and the final properties will be what is in x.properties with values overwritten/added to by x.local.properties.

If you named your second file project.other.properties you would see the behavior you expect.

Nathan

Seems like I was overstepping a hidden feature there. :wink:
Time to try taking advantage of it, can be handy in some cases.

Thanks for looking into it.

Jorge