Liquibase 无法从 Maven 生成更改日志

Liquibase can't generateChangeLog from Maven

我是 运行 Java 17,mvn 3.8.4,liquibase(和 liquibase-maven-plugin)4.7.1,windows 10.

当运行 mvn liquibase:generateChangeLog时,我有这个输出:

> mvn liquibase:generateChangeLog
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< be.liege.cti.tutorial:breakme >--------------------
[INFO] Building breakme 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] --- liquibase-maven-plugin:4.7.1:generateChangeLog (default-cli) @ breakme ---
[INFO] ------------------------------------------------------------------------
[project, pluginDescriptor]
[INFO] Parsing Liquibase Properties File
[INFO]   File: src/main/resources/liquibase.properties
[INFO]   'migrationSqlOutputFile' in properties file is not being used by this task.
[INFO]   'changeLogFile' in properties file is not being used by this task.
[INFO]   'diffChangeLogFile' in properties file is not being used by this task.
[INFO]   'referenceUrl' in properties file is not being used by this task.
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO]
[INFO] Liquibase Community 4.7.1 by Liquibase
[INFO] ####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ##
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ##
##  Free schema change activity reports at        ##
##      https://hub.liquibase.com                 ##
##                                                ##
####################################################
Starting Liquibase at 11:31:27 (version 4.7.1 #1239 built at 2022-01-20 20:31+0000)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.209 s
[INFO] Finished at: 2022-02-18T11:31:27+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:4.7.1:generateChangeLog (default-cli) on project breakme: The output changeLogFile must be specified. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

因此,changeLogFile未被此任务使用并且必须指定输出更改日志文件;-)

有人可以帮助我在我的项目中使用 liquibase 吗? ;-)

非常感谢您的宝贵时间和帮助。

这是 pom.xml 片段:

    <build>
        <plugins>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <configuration>
                    <propertyFile>src/main/resources/liquibase.properties</propertyFile>
                    <changeLogFile>src/main/resources/db/updateDB.xml</changeLogFile>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>${postgresql.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

liquibase.properties 文件:

changeLogFile=src/main/resources/db/changelog/db.changelog-master.xml
diffChangeLogFile=target/db.changelog-diff.xml
# migrationSqlOutputFile is set in pom.xml - See https://liquibase.jira.com/browse/CORE-2708
migrationSqlOutputFile=target/migration.sql
driver=org.postgresql.Driver
referenceUrl=jdbc:postgresql://localhost:5432/breakmedb
url=jdbc:postgresql://localhost:5432/breakmedb
username=breaker
password=br34K

干杯,

错误消息说,必须提供 output changeLogFile。您指定了 changeLogFile 而不是 outputChangeLogFile.