Closed nvoxland closed 2 years ago
Hi @nvoxland
We are trying to upgrade the Liquibase version from 3.8.0 to 4.13.0 things are working in version 3.8.0 fine when we try to upgrade to the 4.13.0 jar we are facing the below error. like unable to find liquibase home environment variable
@Tvvsnal it's best to use the liquibase.bat / liquibase bash script that comes with the CLI distribution. That will correctly set things up for sure.
If you are just trying to run java -jar liquibase.jar
directly for some reason, you do need to set a LIQUIBASE_HOME directory that points to where liquibase should look for an internal/lib
and lib
directory containing jars to add to the classpath
Description
Liquibase doesn't support using
java -jar liquibase.jar
. We should always be pointing people to just run theliquibase
launch script.These were the only places I saw
java -jar
used for liquibase. There are other places that use java -jar for starting h2 which may be better asliquibase init start-h2
now, but I'll open a separate ticket for that.Additional Content
It may also be worth adding a new page about running liquibase without the launch scripts. I'm not sure where that would go so will leave that to someone else to add to this PR.
The stub content would be something like:
Liquibase ships with a liquibase/liquibase.bat launch script which configures Java to run the CLI. That launch script is the best way to run the CLI. When ran, it will:
liquibase.jar
plus what it finds in./liquibase-libs
plus what it finds in LIQUIBASE_HOME/libliquibase.integration.commandline.LiquibaseCommandLine
classIf you do not want to run the liquibase launcher, you can set up the call to java using the pieces of that logic which you need. For example,
java -cp <your classpath> liquibase.integration.commandline.LiquibaseCommandLine <liquibase args>
.NOTE: we don't support
java -jar liquibase.jar
because Java does not allow both-jar
and-cp
being set, and you need control over the classpath to correctly configure Liquibase to run.