使用includeAll时,我们遇到一个主要问题,即databaseChangeLogMaster.xml
文件中的相对路径无效。
includeAll仅适用于绝对路径。示例如下:
下面的不起作用:
<includeAll path="sql/relativetest" />
以下工作正常:
<includeAll path="file:/oravl01/oracle/erd_folder/payment/capm/sql/function/" />
当我们使用"java -jar"
方法运行liquibase更新时,我们得到相对路径的错误,下面是错误,任何帮助都将受到高度赞赏。如果需要更多信息,请告诉我。
DEBUG 1/4/17 11:49 AM: liquibase: Opening jar:file:/oravl01/oracle/liquibase/liquibase.jar!/liquibase/parser/core/xml/dbchangelog-3.1.xsd as liquibase/parser/core/xml/dbchangelog-3.1.xsd
....
INFO 1/4/17 11:49 AM: liquibase: Successfully released change log lock
Unexpected error running Liquibase: Could not find directory or directory was empty for includeAll 'sql/relativetest/'
SEVERE 1/4/17 11:49 AM: liquibase: Could not find directory or directory was empty for includeAll 'sql/relativetest/'
liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'sql/relativetest/'
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.commandline.Main.doMigration(Main.java:1130)
at liquibase.integration.commandline.Main.run(Main.java:188)
at liquibase.integration.commandline.Main.main(Main.java:103)
Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'sql/relativetest/'
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:448)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:352)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:282)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
... 6 more
Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'sql/relativetest/'
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:441)
... 9 more
For more information, use the --logLevel flag