mvn liquibase:update 结果 "Failed to resolve the properties file."

mvn liquibase:update results in "Failed to resolve the properties file."

当我 运行 mvn liquibase:update 时,我在标准输出上得到这些:

[INFO] Executing on Database: jdbc:postgresql://localhost:5432/PROJECT_NAME
INFO 20/09/16 09:41:liquibase: null: null: Successfully acquired change log lock
INFO 20/09/16 09:41:liquibase: null: null: Creating database history table with name: databasechangelog
INFO 20/09/16 09:41:liquibase: null: null: Reading from databasechangelog
INFO 20/09/16 09:41:liquibase: null: null: Reading from databasechangelog
INFO 20/09/16 09:41:liquibase: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-master.yaml: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-1.0.yaml::1::matheus.serpellone: Table PERMISSIONS created
INFO 20/09/16 09:41:liquibase: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-master.yaml: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-1.0.yaml::1::matheus.serpellone: ChangeSet PROJECT_NAME/src/main/resources/db/changelog/db.changelog-1.0.yaml::1::matheus.serpellone ran successfully in 22ms
INFO 20/09/16 09:41:liquibase: PROJECT_NAME/src/main/resources/db/changelog/db.changelog-master.yaml: null: Successfully released change log lock

这表明它已经找到了我的属性文件并且运行它成功了(数据库也更新了)。

但是,命令失败,原因如下:

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.0.5:update (default-cli) on project PROJECT_NAME: Failed to resolve the properties file. -> [Help 1]

(而且,这是 Java,帮助 1 根本没有帮助。当然,它只是说这是一个 MojoFailureException。)

我的 POM 将此作为依赖项:

<!-- Liquid Base -->
<dependency>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-maven-plugin</artifactId>
    <version>3.5.1</version>
</dependency>

这是我配置插件的地方:

<build>
    <plugins>
        <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>3.0.5</version>
            <configuration>
                <propertyFile>PROJECT_NAME/src/main/resources/db/changelog/liquibase.yaml</propertyFile>
            </configuration>
        </plugin>
    </plugins>
</build>

在我的 liquibase.yaml 文件上:

driver: org.postgresql.Driver
classpath: ./lib/postgresql-9.2-1002-jdbc4.jar
url: jdbc:postgresql://localhost:5432/ifood_extranet_bff
username: xxx
password: xxx
changeLogFile: PATH_NAME/src/main/resources/db/changelog/db.changelog-master.yaml

关于db.changelog-master.yaml:

databaseChangeLog:
- include:
    file: extranet-bff-core/src/main/resources/db/changelog/db.changelog-1.0.yaml

和db.changelog-1.0.yaml: --- 数据库更改日志: - 变更集: 编号:1 作者:matheus.serpellone 变化: - 创建表: 表名:权限 列: - 柱子: 姓名:身份证 类型:双整数 自动增量:真 约束: 主键:真 可为空:假 - 柱子: 名称:角色 类型:Varchar(255) 约束: 可为空:假 - 柱子: 名称:许可 类型:Varchar(255) 约束: 可为空:假 ...

所以...可能会给 "Failed to resolve properties file?"

好的,问题是:我试图在我的根 pom.xml 上配置插件,但我还有两个子模块。一个有 liquibase.yaml 文件,另一个没有。

这样,当我在父项目上 运行 mvn liquibase:update 时,它会在第一个模块上成功 运行 迁移,但在第二个模块上会失败,给我输出以上...