Class Main

java.lang.Object
liquibase.integration.commandline.Main

public class Main extends Object
Deprecated.
use liquibase.integration.commandline.LiquibaseCommandLine.
Class for executing Liquibase via the command line.
  • Field Details

    • runningFromNewCli

      public static boolean runningFromNewCli
      Deprecated.
    • newCliChangelogParameters

      public static Map<String,String> newCliChangelogParameters
      Deprecated.
    • classLoader

      protected ClassLoader classLoader
      Deprecated.
    • driver

      protected String driver
      Deprecated.
    • username

      protected String username
      Deprecated.
    • password

      protected String password
      Deprecated.
    • url

      protected String url
      Deprecated.
    • databaseClass

      protected String databaseClass
      Deprecated.
    • defaultSchemaName

      protected String defaultSchemaName
      Deprecated.
    • outputDefaultSchema

      protected String outputDefaultSchema
      Deprecated.
    • outputDefaultCatalog

      protected String outputDefaultCatalog
      Deprecated.
    • liquibaseCatalogName

      protected String liquibaseCatalogName
      Deprecated.
    • liquibaseSchemaName

      protected String liquibaseSchemaName
      Deprecated.
    • databaseChangeLogTableName

      protected String databaseChangeLogTableName
      Deprecated.
    • databaseChangeLogLockTableName

      protected String databaseChangeLogLockTableName
      Deprecated.
    • databaseChangeLogTablespaceName

      protected String databaseChangeLogTablespaceName
      Deprecated.
    • defaultCatalogName

      protected String defaultCatalogName
      Deprecated.
    • changeLogFile

      protected String changeLogFile
      Deprecated.
    • overwriteOutputFile

      protected String overwriteOutputFile
      Deprecated.
    • classpath

      protected String classpath
      Deprecated.
    • contexts

      protected String contexts
      Deprecated.
    • labels

      protected String labels
      Deprecated.
    • labelFilter

      protected String labelFilter
      Deprecated.
    • driverPropertiesFile

      protected String driverPropertiesFile
      Deprecated.
    • propertyProviderClass

      protected String propertyProviderClass
      Deprecated.
    • changeExecListenerClass

      protected String changeExecListenerClass
      Deprecated.
    • changeExecListenerPropertiesFile

      protected String changeExecListenerPropertiesFile
      Deprecated.
    • promptForNonLocalDatabase

      protected Boolean promptForNonLocalDatabase
      Deprecated.
    • includeSystemClasspath

      protected Boolean includeSystemClasspath
      Deprecated.
    • defaultsFile

      protected String defaultsFile
      Deprecated.
    • diffTypes

      protected String diffTypes
      Deprecated.
    • changeSetAuthor

      protected String changeSetAuthor
      Deprecated.
    • changeSetContext

      protected String changeSetContext
      Deprecated.
    • dataOutputDirectory

      protected String dataOutputDirectory
      Deprecated.
    • referenceDriver

      protected String referenceDriver
      Deprecated.
    • referenceUrl

      protected String referenceUrl
      Deprecated.
    • referenceUsername

      protected String referenceUsername
      Deprecated.
    • referencePassword

      protected String referencePassword
      Deprecated.
    • referenceDefaultCatalogName

      protected String referenceDefaultCatalogName
      Deprecated.
    • referenceDefaultSchemaName

      protected String referenceDefaultSchemaName
      Deprecated.
    • currentDateTimeFunction

      protected String currentDateTimeFunction
      Deprecated.
    • command

      protected String command
      Deprecated.
    • commandParams

      protected Set<String> commandParams
      Deprecated.
    • logLevel

      protected String logLevel
      Deprecated.
    • logFile

      protected String logFile
      Deprecated.
    • changeLogParameters

      protected Map<String,Object> changeLogParameters
      Deprecated.
    • outputFile

      protected String outputFile
      Deprecated.
    • excludeObjects

      protected String excludeObjects
      Deprecated.
    • includeCatalog

      protected Boolean includeCatalog
      Deprecated.
    • includeObjects

      protected String includeObjects
      Deprecated.
    • includeSchema

      protected Boolean includeSchema
      Deprecated.
    • includeTablespace

      protected Boolean includeTablespace
      Deprecated.
    • deactivate

      protected Boolean deactivate
      Deprecated.
    • outputSchemasAs

      protected String outputSchemasAs
      Deprecated.
    • referenceSchemas

      protected String referenceSchemas
      Deprecated.
    • schemas

      protected String schemas
      Deprecated.
    • snapshotFormat

      protected String snapshotFormat
      Deprecated.
    • liquibaseProLicenseKey

      protected String liquibaseProLicenseKey
      Deprecated.
    • sqlFile

      protected String sqlFile
      Deprecated.
    • delimiter

      protected String delimiter
      Deprecated.
    • rollbackScript

      protected String rollbackScript
      Deprecated.
    • rollbackOnError

      protected Boolean rollbackOnError
      Deprecated.
    • schemaList

      protected List<CatalogAndSchema> schemaList
      Deprecated.
    • format

      protected String format
      Deprecated.
    • showSummary

      protected String showSummary
      Deprecated.
  • Constructor Details

    • Main

      public Main()
      Deprecated.
  • Method Details

    • main

      public static void main(String[] args)
      Deprecated.
      Entry point. This is what gets executes when starting this program from the command line. This is actually a simple wrapper so that an errorlevel of != 0 is guaranteed in case of an uncaught exception.
      Parameters:
      args - the command line arguments
    • run

      public static int run(String[] args) throws Exception
      Deprecated.
      Process the command line arguments and perform the appropriate main action (update, rollback etc.)
      Parameters:
      args - the command line arguments
      Returns:
      the errorlevel to be returned to the operating system, e.g. for further processing by scripts
      Throws:
      LiquibaseException - a runtime exception
      Exception
    • setLogLevel

      protected static void setLogLevel(LogService logService, Logger rootLogger, Logger liquibaseLogger, Level level)
      Deprecated.
    • parseDefaultPropertyFiles

      protected void parseDefaultPropertyFiles() throws CommandLineParsingException
      Deprecated.
      Search for both liquibase.properties (or whatever the name of the current defaultsFile is) and the "local" variant liquibase.local.properties. The contents of the local variant overwrite parameters with the same name in the regular properties file.
      Throws:
      CommandLineParsingException - if an error occurs during parsing
    • fixupArgs

      protected String[] fixupArgs(String[] args)
      Deprecated.
      On windows machines, it splits args on '=' signs. Put it back like it was.
    • checkSetup

      protected List<String> checkSetup()
      Deprecated.
      After parsing, checks if the given combination of main command and can be executed.
      Returns:
      an empty List if successful, or a list of error messages
    • parsePropertiesFile

      protected void parsePropertiesFile(InputStream propertiesInputStream) throws IOException, CommandLineParsingException
      Deprecated.
      Reads various execution parameters from an InputStream and sets our internal state according to the values found.
      Parameters:
      propertiesInputStream - an InputStream from a Java properties file
      Throws:
      IOException - if there is a problem reading the InputStream
      CommandLineParsingException - if an invalid property is encountered
    • printHelp

      protected void printHelp(List<String> errorMessages, PrintStream stream)
      Deprecated.
      If any errors have been found, print the list of errors first, then print the command line help text.
      Parameters:
      errorMessages - List of error messages
      stream - the output stream to write the text to
    • printHelp

      protected void printHelp(PrintStream stream)
      Deprecated.
      Print instructions on how to use this program from the command line.
      Parameters:
      stream - the output stream to write the help text to
    • checkArg

      protected static Main.CodePointCheck checkArg(String arg)
      Deprecated.
      Check the string for known characters which cannot be handled
      Parameters:
      arg - Input parameter to check
      Returns:
      int A CodePointCheck object, or null to indicate all good
    • parseOptions

      protected void parseOptions(String[] paramArgs) throws CommandLineParsingException
      Deprecated.
      Parses the command line options. If an invalid argument is given, a CommandLineParsingException is thrown.
      Parameters:
      paramArgs - the arguments to parse
      Throws:
      CommandLineParsingException - thrown if an invalid argument is passed
    • applyDefaults

      protected void applyDefaults()
      Deprecated.
    • configureClassLoader

      protected ClassLoader configureClassLoader() throws CommandLineParsingException
      Deprecated.
      Throws:
      CommandLineParsingException
    • doMigration

      protected void doMigration() throws Exception
      Deprecated.
      Do the actual database migration, i.e. apply the ChangeSets.
      Throws:
      Exception
    • setOutputStream

      public static PrintStream setOutputStream(PrintStream outputStream)
      Deprecated.
      Sets the default outputstream to use. Mainly useful for testing and the Command wrappers.
    • isWindows

      public boolean isWindows()
      Deprecated.
      Determines if this program is executed on a Microsoft Windows-type of operating system.
      Returns:
      true if running under some variant of MS Windows, false otherwise.