我有一个使用 liquibase-core 3.7.0 的spring boot gradle项目,大致按照Unable to generate difference from liquibase gradle plugin
中的答案进行操作使用 Java 11 并运行任务 liquibaseDiffChangelog ,我现在遇到以下错误:
Starting Liquibase at Thu, 08 Aug 2019 13:52:35 BST (version 3.7.0 built at 2019-07-16 02:32:57)
Unexpected error running Liquibase: class liquibase.command.DiffToChangeLogCommand cannot be cast to class liquibase.command.core.DiffToChangeLogCommand (liquibase.command.DiffToChangeLogCommand and liquibase.command.core.DiffToChangeLogCommand are in unnamed module of loader 'app')
java.lang.ClassCastException: class liquibase.command.DiffToChangeLogCommand cannot be cast to class liquibase.command.core.DiffToChangeLogCommand (liquibase.command.DiffToChangeLogCommand and liquibase.command.core.DiffToChangeLogCommand are in unnamed module of loader 'app')
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:226)
at liquibase.integration.commandline.Main.doMigration(Main.java:1011)
at liquibase.integration.commandline.Main.run(Main.java:192)
at liquibase.integration.commandline.Main.main(Main.java:130)
答案 0 :(得分:0)
这是由您的版本中的版本冲突引起的。
您需要将liquibase版本降级为3.5.5,因为之后引入了重大更改。
一种方法是在Gradle配置中强制执行操作
router.post('/upload_img_mt', function(req, res, next){
console.log("files: " +req.files);
console.log("file: " +req.file);
res.sendStatus(200);
});