如何在“mvn liquibase:diff”中设置diffChangeLogFile参数?

时间:2014-07-22 17:11:52

标签: maven liquibase

我运行“mvn liquibase:diff”并已配置diffChangeLogFile,但diffChangeLogFile文件只有头信息。(如下所示)

diff.changelog.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"/>

但是我使用相同的配置以命令行方式运行liquibase diff,diffChangeLogFile文件中有正确的信息。

我的 pom.xml ,如下所示:

<execution> <id>diff</id> <configuration> <changeLogFile>src/main/resources/db/insert_person6.xml</changeLogFile> <driver>org.postgresql.Driver</driver> <url>${liquabase.url}</url> <username>${liquabase.username}</username> <password>${liquabase.urpasswordl}</password> <referenceUrl>${liquabase.referenceUrl}</referenceUrl> <referenceUsername>${liquabase.referenceUsername}</referenceUsername> <referencePassword>${liquabase.referencePassword}</referencePassword> <diffChangeLogFile>${liquabase.diffChangeLogFile}</diffChangeLogFile> </configuration> <goals> <goal>diff</goal> </goals> </execution>

有没有人遇到同样的问题?

1 个答案:

答案 0 :(得分:1)

这应该有效,并且在写入diffChangeLogFile的情况下,必须正确设置参数。

您看到的空文件通常是通过比较两个相同的数据库引起的。也许您的liquibase.url和liquibase.refereneceUrl设置不正确。

如果你运行liquibase:diff而没有diffChangelogFile参数,它应该创建一个包含连接信息的差异报告。看看它是否符合您的预期。

相关问题