打包应用程序时未执行 Liquibase 脚本

Liquibase scripts not getting executed when app is packaged

我在使用 Liquibase 时遇到了一个奇怪的问题(我使用的是 3.4.2):

INFO 8 --- [ main] liquibase : Successfully acquired change log lock
WARN 8 --- [ main] liquibase : included file classpath:/db/changelog/db.changelog-master.yaml/ is not a recognized file type

我正在使用 includeAll 模式:

databaseChangeLog:
  - includeAll:
      path: changes
      relativeToChangelogFile: true

此外,如果它有所不同,我的应用程序中有几个模块(Spring 启动应用程序):

问题似乎与此处描述的问题类似:http://forum.liquibase.org/topic/includeall-not-working-for-multimodule-project-with-spring,但未提供解决方案。

在尝试了各种方法之后,比如一个一个地包含文件,或者升级 Liquibase 版本,看起来最简单的方法就是调整模块 A 的 spring-boot-maven-plugin 配置通过解压文件:这样,Liquibase 就能够找到它正在寻找的文件。

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <requiresUnpack>
                    <dependency>
                        <groupId>com.mydomain</groupId>
                        <artifactId>moduleB</artifactId>
                    </dependency>
                </requiresUnpack>
            </configuration>
        </plugin>