我使用Dropwizard框架创建了java应用程序,我使用了liquibase迁移。我能够运行" db migrate"来自eclipse的命令,但同一命令从终端cli失败。
我一直试图在我的设置中找到错误,但现在我需要liquibase专家的一些帮助。这是打印的错误日志。请让我知道 - 可能是错的。
OS : MAC OS X
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
java -jar target/code.jar db migrate src/main/resources/code-local.yml
INFO [2015-09-07 11:36:00,288] liquibase: Successfully acquired change log lock
INFO [2015-09-07 11:36:07,866] liquibase: Successfully released change log lock
Exception in thread "main" liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: /var/folders/7y/3wfpy71x4j779d854h_g_h48zrgjtv/T/liquibase-unzip3153640369191170689.dir/license/LICENSE (Not a directory)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:215)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:181)
at liquibase.Liquibase.update(Liquibase.java:174)
at io.dropwizard.migrations.DbMigrateCommand.run(DbMigrateCommand.java:57)
at io.dropwizard.migrations.DbCommand.run(DbCommand.java:52)
at io.dropwizard.migrations.AbstractLiquibaseCommand.run(AbstractLiquibaseCommand.java:63)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76)
at io.dropwizard.cli.Cli.run(Cli.java:70)
at io.dropwizard.Application.run(Application.java:73)
at com.x.y.MainApplication.main(MainApplication.java:39)
Caused by: liquibase.exception.SetupException: /var/folders/7y/3wfpy71x4j779d854h_g_h48zrgjtv/T/liquibaseunzip3153640369191170689.dir/license/LICENSE (Not a directory)
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:334)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:264)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
... 11 more
Caused by: java.io.FileNotFoundException: /var/folders/7y/3wfpy71x4j779d854h_g_h48zrgjtv/T/liquibase-unzip3153640369191170689.dir/license/LICENSE (Not a directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at liquibase.util.FileUtil.unzip(FileUtil.java:76)
at liquibase.resource.ClassLoaderResourceAccessor.list(ClassLoaderResourceAccessor.java:82)
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:316)
... 14 more
答案 0 :(得分:1)
您是否尝试将Liquibase库文件夹添加到类路径中?
java -jar liquibase.jar;lib/snakeyaml-1.13.jar;target/code.jar db migrate src/main/resources/code-local.yml
我已经提到了liquibase 3.4.1版本的jar文件名。根据您的设置进行更改。