Cannot pass property using -Dproperty=value

When I try to run Liquibase on the command line passing a property using
the -D switch I always get an error:



liquibase
-Dtable_owner=foo --defaultsFile=connection.properties
–changeLogFile=changelog.xml update

results in the error:

Errors:
Unexpected value -Dtable_owner=foo: parameters must start with a '--'

Usage: java -jar liquibase.jar [options] [command]
(Needless to say that --Dtable_owner=foo doesn't work either)

When I try the -D at the end of the line (as shown here)

liquibase --defaultsFile=connection.properties --changeLogFile=changelog.xml update -Dtable_owner=foo

I get the error:


Unexpected error running Liquibase: Unknown parameter: 'table_owner'

SEVERE 11/3/15 10:41 AM: liquibase: Unknown parameter: 'table_owner'
liquibase.exception.CommandLineParsingException: Unknown parameter: 'table_owner'
at liquibase.integration.commandline.Main.parsePropertiesFile(Main.java:453)
at liquibase.integration.commandline.Main.run(Main.java:159)
at liquibase.integration.commandline.Main.main(Main.java:99)


What am I missing?
I am using Liquibase 3.4.1

How do I pass a parameter (that is used with "${table_owner}" in the changeLog) on the command line?


I think you need to specify the parameters after the “update”
command, so:



liquibase
–defaultsFile=connection.properties
–changeLogFile=changelog.xml update -Dtable_owner=foo

Thanks for the answer, but that was my second try ("When I try the -D at the end of the line (as shown here) ") and that also results in an error - although a different one (see the second error in my question).

Thanks for the answer. I did try that and also got an error - but that was unrelated to my commandline. My properties file contained a line “table_owner: foo” which caused the error. Passing -D after the update command indeed does work.

Sorry for the noise.